<template>
  <div class="app-container" v-loading="loading">
    <div class="head-container">
      <el-form
        ref="vForm"
        :model="form"
        :rules="rules"
        label-position="right"
        label-width="80px"
        size="medium"
        @submit.native.prevent
      >
        <el-row>
          <el-col :span="4" class="grid-cell">
            <div class="tip"><div>人员信息</div></div>

            <div style="margin-bottom: 10px;display: flex;align-items: center">
                <el-input placeholder="请输入体检编号" v-model="searchParams.checkCode" clearable class="input-with-select">
                  <el-button slot="append" icon="el-icon-search" @click="SeachCheckcode"></el-button>
                </el-input>
                <div class="more" @click="dialogSearch=true">更多></div>
            </div>

            <div class="tip">人员列表</div>
            <el-table
              ref="multiplePersonTable"
              border
              stripe
              :data="DataPersonlist"
              highlight-current-row
              @row-click="handleCurrentChange"
              max-height="500"
            >
              <el-table-column
                v-for="col in Personlist"
                :key="col.prop"
                :prop="col.prop"
                :label="col.label"
                :width="col.width"
                align="center"
              />
              <el-table-column label="状态" align="center" width="70">
                <template slot-scope="scope">
                  <dict-tag :options="dict.type.dime_physical_completstatus" :value="scope.row.completStatus"/>
                </template>
              </el-table-column>
            </el-table>
          </el-col>

          <el-col :span="20" class="grid-cell">
            <el-row>
              <el-col :span="4" class="grid-cell">
                <el-form-item label="" prop="pictureupload92945">
                  <div class="block">
                    <el-image
                      style="width: 85px; height: 100px"
                      :src="`data:image/png;base64,${form.headpicture}`"
                      fit="fill"
                    />
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="20" class="grid-cell">
                <el-descriptions title="人员信息">
                  <el-descriptions-item label="姓名">{{
                    this.form.name
                  }}</el-descriptions-item>
                  <el-descriptions-item label="性别">
                    <dict-tag :options="dict.type.sys_user_sex" :value="form.sex"/>
                  </el-descriptions-item>
                  <el-descriptions-item label="年龄">{{
                    this.form.age
                  }}</el-descriptions-item>
                  <el-descriptions-item label="单位名称">{{
                    this.form.companyName
                  }}</el-descriptions-item>
                  <el-descriptions-item label="在岗状态">
                    <dict-tag :options="dict.type.dime_physical_work" :value="form.workStatus"/>
                  </el-descriptions-item>
                  <el-descriptions-item label="危害因素">{{
                      this.form.touchHarms
                  }}</el-descriptions-item>
                </el-descriptions>
              </el-col>
            </el-row>
            <el-row style="margin-left: 5px">
              <el-tabs v-model="activeName">
                <el-tab-pane label="结论及建议" name="first">
                  <el-row>
                    <el-col :span="12">
                      <el-form-item
                        label="异常结果"
                        prop="abnormalresult"
                        class="label-right-align"
                      >
                        <el-input
                          type="textarea"
                          :rows="8"
                          placeholder="请输入内容"
                          v-model="form.dimeMaincheckconclusion.abnormalresult"
                        >
                        </el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item
                        label="健康建议"
                        prop="healthsuggestion"
                      >
                        <el-input
                          type="textarea"
                          :rows="7"
                          placeholder="请输入内容"
                          v-model="form.dimeMaincheckconclusion.healthDesc"
                          @dblclick.native="SelectHeathAdvice()"
                        >
                        </el-input>
                      </el-form-item>
                      <div align="right" style="margin-bottom: 8px">
                        <el-button
                          size="mini"
                          type="primary"
                          @click="dialogHealthAdvice=true"
                        >选择健康建议</el-button>
                      </div>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-form-item
                      label="扁鹊健康建议"
                      label-width="110px"
                    >
                      <el-input
                        type="textarea"
                        :rows="4"
                        placeholder="请输入内容"
                        readonly
                        v-model="bianquehealthDesc"
                      >
                      </el-input>
                    </el-form-item>
                  </el-row>
                  <el-row :gutter="20">
                      <el-col :span="12">
                        <el-form-item
                          label="主检结论"
                          prop="mainconclusion"
                        >

                          <el-select
                            v-model="form.dimeMaincheckconclusion.conclusionId"
                            clearable
                            style="width: 100%"
                            @change="mainconclusionChange"
                            :disabled="showCon"
                          >
                            <el-option
                              v-for="(item, index) in conclusionoptions"
                              :key="index"
                              :label="item.abbreviation"
                              :value="item.id"
                            ></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item
                          label="特殊关注"
                          prop="care"
                          label-width="80px"
                        >
                          <el-checkbox v-model="form.dimeMaincheckconclusion.focusTag" :true-label="1" :false-label="0"></el-checkbox>
                        </el-form-item>
                      </el-col>
                    </el-row>
                  <el-row>
                      <el-col :span="24">
                        <el-form-item
                          label="主检建议"
                          prop="Mainconsionsuggestion"
                        >
                          <el-input
                            type="textarea"
                            :rows="5"
                            placeholder="请输入内容"
                            v-model="form.dimeMaincheckconclusion.conclusionadvice"
                          >
                          </el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                  <el-tabs v-model="harms">
                      <el-tab-pane
                        v-for="(ele,index) in form.maincheckHarmDtoList"
                        :label="ele.baseHarmName"
                        :name="String(ele.baseHarmName)"
                        :key="index"
                      >
                        <el-row :gutter="20">
                          <el-col :span="12">
                              <el-divider content-position="left"
                              >结论描述</el-divider
                              >
                              <el-form-item
                                label="危害结论"
                                prop="harmconclusion"
                                label-width="80px"
                              >
                                <el-select
                                  v-model="ele.conclusionId"
                                  class="full-width-input"
                                  clearable
                                  :key="index"
                                  style="width: 100%"
                                  @change="HarmMainConsionChange($event, ele)"
                                  :disabled="showCon"
                                >
                                  <el-option
                                    v-for="(item, index) in conclusionoptions"
                                    :key="index"
                                    :label="item.abbreviation"
                                    :value="item.id"
                                  ></el-option>
                                </el-select>
                              </el-form-item>

                              <el-form-item
                                label="结论描述"
                                prop="consiondec"
                                label-width="80px"
                              >
                                <el-select
                                  v-model="ele.dimeMaincheckharmadvice.conclusionadviceId"
                                  :disabled="ele.showDec"
                                  class="full-width-input"
                                  clearable
                                  :key="index"
                                  style="width: 100%"
                                  @change="harmadviceChange($event, ele)"
                                >
                                  <el-option
                                    v-for="(item, index) in ele.conclusionadviceList"
                                    :key="index"
                                    :label="item.abbreviation"
                                    :value="item.id"
                                  ></el-option>
                                </el-select>
                              </el-form-item>
                              <el-form-item
                              label="异常描述"
                              prop="abnormaldesc"
                              label-width="80px"
                            >
                              <el-input
                                type="textarea"
                                :rows="3"
                                @input="forceUpdate"
                                placeholder="请输入异常描述"
                                v-model="ele.dimeMaincheckharmconclusion.abnormaldesc"
                              >
                              </el-input>
                            </el-form-item>
                            <el-row>
                              <div align="right">
                                <el-button
                                  size="mini"
                                  type="primary"
                                  @click="BulidAbnormalDesc(ele)"
                                >生成异常描述</el-button
                                >
                              </div>
                            </el-row>
                            </el-col>
                          <el-col :span="12">
                              <el-divider content-position="left"
                              >异常项目</el-divider
                              >
                              <el-table
                                ref="abnormalTable"
                                border
                                stripe
                                default-selection="ele.dimeBasecombcriterionDtoList"
                                :data="ele.dimeBasecombcriterionDtoList"
                                size="small"
                                height="180px"
                                style="width: 100%"
                              >
                                <el-table-column  width="44px" >
                                  <template slot-scope="scope">
                                    <el-checkbox v-model="scope.row.checked" @change="handleSelectionChange(ele)"></el-checkbox>
                                  </template>
                                </el-table-column>
                                <el-table-column
                                  v-for="col in mainHarmcombolumnLit"
                                  :key="col.prop"
                                  :prop="col.prop"
                                  :label="col.label"
                                  align="center"
                                />
                              </el-table>
                            </el-col>
                        </el-row>
                        <el-row :gutter="20">
                          <el-col :span="12">
                              <el-divider content-position="left"
                              >异常处理</el-divider
                              >

                              <el-form-item
                                label="疑似职业病"
                                prop="harmOCCDiseases"
                                label-width="110px"
                              >
                                <el-select
                                  v-model="ele.dimeMaincheckharmoccupationaldiseaeIds"
                                  clearable
                                  style="width: 100%"
                                  multiple
                                  placeholder="请选择疑似职业病"
                                  :disabled="ele.OCCDiseasesdisabled"
                                  @change="dimeMaincheckharmoccupationaldiseaeChange($event, ele)"
                                >
                                  <el-option
                                    v-for="(
                                    item, index
                                  ) in ele.dimeBaseoccupationaldiseasecriterionList"
                                    :key="index"
                                    :label="item.occupationaldiseaeName"
                                    :value="item.occupationaldiseaeId"
                                  ></el-option>
                                </el-select>
                              </el-form-item>
                              <el-form-item
                                label="职业禁忌症"
                                prop="harmcontraindication"
                                label-width="110px"
                              >
                                <el-select
                                  v-model="ele.dimeMaincheckharmcontraindicationIds"
                                  clearable
                                  style="width: 100%"
                                  :disabled="ele.contraindicationsdisabled"
                                  multiple
                                  placeholder="请选择职业禁忌症"
                                  @change="dimeMaincheckharmcontraindicationListChange($event, ele)"
                                >
                                  <el-option
                                    v-for="(
                                    item, index
                                  ) in ele.dimeBasecontraindicationcriterionList"
                                    :key="index"
                                    :label="item.cationcriterionName"
                                    :value="item.cationcriterionId"
                                  ></el-option>
                                </el-select>
                              </el-form-item>

                              <el-form-item
                                label="复查项目"
                                prop="harmrecheckcomb"
                                label-width="110px"
                              >
                                <el-select
                                  v-model="ele.dimeMaincheckharmrecheckcombIds"
                                  clearable
                                  style="width: 100%"
                                  :disabled="ele.checkdisabled"
                                  multiple
                                  filterable
                                  placeholder="请选择复查项目"
                                  prefix-icon="el-icon-search"
                                  @change="Recheckcombchange($event, ele)"
                                >
                                  <el-option
                                    v-for="item in comblists"
                                    :key="item.id"
                                    :label="item.combName"
                                    :value="item.id"
                                  ></el-option>
                                </el-select>
                              </el-form-item>
                              <el-form-item
                                label="其他疾病和异常"
                                prop="harmrecheckcomb"
                                label-width="110px"
                              >
                                <el-input
                                  v-model="ele.harmotherdisease"
                                  placeholder="输入其他疾病和异常"
                                  :disabled="ele.otherdisabled"
                                />
                              </el-form-item>
                            </el-col>
                          <el-col :span="12">
                              <el-divider content-position="left"
                              >结论建议</el-divider
                              >
                              <el-form-item
                                label="危害建议"
                                prop="advicedescribe"
                              >
                                <el-input
                                  type="textarea"
                                  :rows="6"
                                  @input="forceUpdate"
                                  placeholder="请输入内容"
                                  v-model="ele.dimeMaincheckharmconclusion.advicedescribe"
                                >
                                </el-input>
                              </el-form-item>

                              <el-row>
                                <div align="right">
                                  <el-button
                                    size="mini"
                                    type="primary"
                                    @click="bulidHarmAdvice(ele)"
                                  >生成危害建议</el-button>
                                </div>
                              </el-row>
                            </el-col>
                        </el-row>
                      </el-tab-pane>


                    </el-tabs>
                  <el-row>
                      <el-divider content-position="left"
                      >其他疾病和异常</el-divider
                      >
                      <el-col :span="12">
                          <el-table
                            ref="otherdiseaseTable"
                            border
                            stripe
                            :data="otherdiseaselist"
                            size="small"
                            height="250px"
                            @selection-change="handleDiseaseChange"
                          >
                            <el-table-column type="selection" width="55" align="center" />
                            <el-table-column label="项目名称" align="center" prop="combName" />
                          </el-table>
                      </el-col>

                      <el-col :span="12">
                        <el-form-item
                          label="异常结果"
                          prop="otherdiseaadvice"
                          class="label-right-align"
                          label-width="100px"
                        >
                          <el-input
                            type="textarea"
                            :rows="8"
                            placeholder="请输入内容"
                            v-model="form.dimeMaincheckotherdisease.otherdiseaadvice"
                          >
                          </el-input>
                        </el-form-item>
                        <el-row>
                          <div align="right">
                            <el-button
                              size="mini"
                              type="primary"
                              @click="BulidDiseaseAdvice()"
                            >生成其他疾病建议</el-button
                            >
                          </div>
                        </el-row>
                      </el-col>
                    </el-row>
                </el-tab-pane>

                <el-tab-pane label="检查结果" name="two">
                  <el-table
                    ref="PersnItems"
                    border
                    :data="checkResultLists"
                    height="680px"
                    :row-class-name="isTagRed"
                  >
                    <!-- <el-table-column type="index" label="No." :width="50" /> -->
                    <el-table-column type="index" label="No." :width="50" />
                    <el-table-column
                      v-for="col in mainSubscolumnLit"
                      :key="col.prop"
                      :prop="col.prop"
                      :label="col.label"
                      :width="col.width"
                      align="center"
                    />
                    <el-table-column
                      prop="passTag"
                      label="合格标记"
                      align="center"
                      width="150px"
                    >
                      <template scope="scope">
                        <el-checkbox v-model="scope.row.passTag" :true-label="1" :false-label="0"
                        >合格</el-checkbox
                        >
                      </template>
                    </el-table-column>
                  </el-table>
                </el-tab-pane>
                <el-tab-pane label="问诊结果" name="three" v-if="inquiryDto">
                  <!-- 职业史 -->
                  <el-row style="margin-left: 8px;margin-bottom:40px">
                    <el-tabs v-model="occupationName" style="height: 210px">
                      <el-tab-pane label="职业史" name="first">
                        <el-table
                          border
                          stripe
                          :data="inquiryDto.inquiryoccupations"
                          size="small"
                          height="160px"
                          style="width: 99%; margin-left: 4px"
                        >
                          <el-table-column type="index" label="No." :width="50" />
                          <el-table-column
                            :key="EmploymentcolumnList[0].prop"
                            :prop="EmploymentcolumnList[0].prop"
                            :label="EmploymentcolumnList[0].label"
                            :width="EmploymentcolumnList[0].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-date-picker
                                is-range
                                v-model="scope.row.datefromto"
                                type="daterange"
                                class="full-width-input"
                                format="yyyy-MM-dd"
                                value-format="yyyy-MM-dd"
                                readonly
                                style="width: 240px"
                              ></el-date-picker>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="EmploymentcolumnList[1].prop"
                            :prop="EmploymentcolumnList[1].prop"
                            :label="EmploymentcolumnList[1].label"
                            :width="EmploymentcolumnList[1].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.company"
                                type="text"
                                readonly
                              ></el-input>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="EmploymentcolumnList[2].prop"
                            :prop="EmploymentcolumnList[2].prop"
                            :label="EmploymentcolumnList[2].label"
                            :width="EmploymentcolumnList[2].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.workshop"
                                type="text"
                                readonly
                              ></el-input>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="EmploymentcolumnList[3].prop"
                            :prop="EmploymentcolumnList[3].prop"
                            :label="EmploymentcolumnList[3].label"
                            :width="EmploymentcolumnList[3].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.occupationtype"
                                type="text"
                                readonly
                              ></el-input>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="EmploymentcolumnList[4].prop"
                            :prop="EmploymentcolumnList[4].prop"
                            :label="EmploymentcolumnList[4].label"
                            :width="EmploymentcolumnList[4].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.harmfactor"
                                type="text"
                                readonly
                              ></el-input>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="EmploymentcolumnList[5].prop"
                            :prop="EmploymentcolumnList[5].prop"
                            :label="EmploymentcolumnList[5].label"
                            :width="EmploymentcolumnList[5].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-select v-model="scope.row.protectmeasure" disabled>
                                <el-option
                                  v-for="dict in dict.type.dime_inquiry_protectmeasure"
                                  :key="dict.value"
                                  :label="dict.label"
                                  :value="dict.value"
                                ></el-option>
                              </el-select>
                            </template>
                          </el-table-column>
                        </el-table>
                      </el-tab-pane>

                      <el-tab-pane label="既往病史" name="second">
                        <el-table
                          border
                          stripe
                          :data="inquiryDto.inquirydisease"
                          size="small"
                          height="160px"
                          style="width: 99%; margin-left: 4px"
                        >
                          <el-table-column type="index" label="No." :width="50" />

                          <el-table-column
                            :key="medicalcolumnList[0].prop"
                            :prop="medicalcolumnList[0].prop"
                            :label="medicalcolumnList[0].label"
                            :width="medicalcolumnList[0].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.diseaseName"
                                type="text"
                                readonly
                              ></el-input>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="medicalcolumnList[1].prop"
                            :prop="medicalcolumnList[1].prop"
                            :label="medicalcolumnList[1].label"
                            :width="medicalcolumnList[1].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-date-picker
                                v-model="scope.row.diagnoseDate"
                                type="date"
                                class="full-width-input"
                                format="yyyy-MM-dd"
                                value-format="yyyy-MM-dd"
                                readonly
                                style="width: 240px"
                              ></el-date-picker>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="medicalcolumnList[2].prop"
                            :prop="medicalcolumnList[2].prop"
                            :label="medicalcolumnList[2].label"
                            :width="medicalcolumnList[2].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.diagnosis"
                                type="text"
                                readonly
                              ></el-input>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="medicalcolumnList[3].prop"
                            :prop="medicalcolumnList[3].prop"
                            :label="medicalcolumnList[3].label"
                            :width="medicalcolumnList[3].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.treatment"
                                type="text"
                                readonly
                              ></el-input>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="medicalcolumnList[4].prop"
                            :prop="medicalcolumnList[4].prop"
                            :label="medicalcolumnList[4].label"
                            :width="medicalcolumnList[4].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.returnTo"
                                type="text"
                                readonly
                              ></el-input>
                            </template>
                          </el-table-column>
                        </el-table>
                      </el-tab-pane>

                      <el-tab-pane label="急慢性职业病史" name="thrid">
                        <el-table
                          ref="chronicmultipleTable"
                          border
                          stripe
                          :data="inquiryDto.inquirychronicoccupationalhistory"
                          size="small"
                          height="160px"
                          style="width: 99%; margin-left: 4px"
                        >
                          <el-table-column type="index" label="No." :width="50" />
                          <el-table-column
                            :key="chroniccolumnList[0].prop"
                            :prop="chroniccolumnList[0].prop"
                            :label="chroniccolumnList[0].label"
                            :width="chroniccolumnList[0].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.diseasName"
                                type="text"
                              ></el-input>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="medicalcolumnList[1].prop"
                            :prop="medicalcolumnList[1].prop"
                            :label="medicalcolumnList[1].label"
                            :width="medicalcolumnList[1].width"
                            align="center"
                          >

                            <template slot-scope="scope">
                              <el-date-picker
                                v-model="scope.row.diagnosisdate"
                                type="date"
                                class="full-width-input"
                                format="yyyy-MM-dd"
                                value-format="yyyy-MM-dd"
                                clearable

                              ></el-date-picker>
                            </template>
                          </el-table-column>
                          <el-table-column
                            :key="chroniccolumnList[2].prop"
                            :prop="chroniccolumnList[2].prop"
                            :label="chroniccolumnList[2].label"
                            :width="chroniccolumnList[2].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.company"
                                type="text"
                              ></el-input>
                            </template>
                          </el-table-column>
                          <el-table-column
                            :key="chroniccolumnList[3].prop"
                            :prop="chroniccolumnList[3].prop"
                            :label="chroniccolumnList[3].label"
                            :width="chroniccolumnList[3].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-switch
                                v-model="scope.row.isheal"
                                active-color="#13ce66"
                                inactive-color="#ff4949"
                                active-value="1"
                                inactive-value="0"
                              >
                              </el-switch>
                            </template>
                          </el-table-column>
                        </el-table>
                      </el-tab-pane>
                      <div v-if="form.checkType!=='02'">
                        <el-tab-pane label="放射职业史" name="fourth">
                          <el-table
                            border
                            stripe
                            :data="inquiryDto.inquiryradiationoccupations"
                            size="small"
                            height="160px"
                            style="width: 99%; margin-left: 4px"
                          >
                            <el-table-column type="index" label="No." :width="50" />

                            <el-table-column
                              :key="RadiationemploymentcolumnList[0].prop"
                              :prop="RadiationemploymentcolumnList[0].prop"
                              :label="RadiationemploymentcolumnList[0].label"
                              :width="RadiationemploymentcolumnList[0].width"
                              align="center"
                            >
                              <template slot-scope="scope">
                                <el-date-picker
                                  is-range
                                  v-model="scope.row.datefromto"
                                  type="daterange"
                                  class="full-width-input"
                                  format="yyyy-MM-dd"
                                  value-format="yyyy-MM-dd"
                                  style="width: 240px"
                                  readonly
                                ></el-date-picker>
                              </template>
                            </el-table-column>

                            <el-table-column
                              :key="RadiationemploymentcolumnList[1].prop"
                              :prop="RadiationemploymentcolumnList[1].prop"
                              :label="RadiationemploymentcolumnList[1].label"
                              :width="RadiationemploymentcolumnList[1].width"
                              align="center"
                            >
                              <template slot-scope="scope">
                                <el-input
                                  v-model="scope.row.company"
                                  type="text"
                                  readonly
                                ></el-input>
                              </template>
                            </el-table-column>
                            <el-table-column
                              :key="RadiationemploymentcolumnList[2].prop"
                              :prop="RadiationemploymentcolumnList[2].prop"
                              :label="RadiationemploymentcolumnList[2].label"
                              :width="RadiationemploymentcolumnList[2].width"
                              align="center"
                            >
                              <template slot-scope="scope">
                                <el-input
                                  v-model="scope.row.workshop"
                                  type="text"
                                  readonly
                                ></el-input>
                              </template>
                            </el-table-column>
                            <el-table-column
                              :key="RadiationemploymentcolumnList[3].prop"
                              :prop="RadiationemploymentcolumnList[3].prop"
                              :label="RadiationemploymentcolumnList[3].label"
                              :width="RadiationemploymentcolumnList[3].width"
                              align="center"
                            >
                              <template slot-scope="scope">
                                <el-input
                                  v-model="scope.row.occupationtype"
                                  type="text"
                                  readonly
                                ></el-input>
                              </template>
                            </el-table-column>
                            <el-table-column
                              :key="RadiationemploymentcolumnList[4].prop"
                              :prop="RadiationemploymentcolumnList[4].prop"
                              :label="RadiationemploymentcolumnList[4].label"
                              :width="RadiationemploymentcolumnList[4].width"
                              align="center"
                            >
                              <template slot-scope="scope">
                                <el-input
                                  v-model="scope.row.occupationexposure"
                                  type="text"
                                  readonly
                                ></el-input>
                              </template>
                            </el-table-column>
                            <el-table-column
                              :key="RadiationemploymentcolumnList[5].prop"
                              :prop="RadiationemploymentcolumnList[5].prop"
                              :label="RadiationemploymentcolumnList[5].label"
                              :width="RadiationemploymentcolumnList[5].width"
                              align="center"
                            >
                              <template slot-scope="scope">
                                <el-input
                                  v-model="scope.row.radiationcategory"
                                  type="text"
                                  readonly
                                ></el-input>
                              </template>
                            </el-table-column>
                            <el-table-column
                              :key="RadiationemploymentcolumnList[6].prop"
                              :prop="RadiationemploymentcolumnList[6].prop"
                              :label="RadiationemploymentcolumnList[6].label"
                              :width="RadiationemploymentcolumnList[6].width"
                              align="center"
                            >
                              <template slot-scope="scope">
                                <el-input
                                  v-model="scope.row.workhours"
                                  type="text"
                                  readonly
                                ></el-input>
                              </template>
                            </el-table-column>
                            <el-table-column
                              :key="RadiationemploymentcolumnList[7].prop"
                              :prop="RadiationemploymentcolumnList[7].prop"
                              :label="RadiationemploymentcolumnList[7].label"
                              :width="RadiationemploymentcolumnList[7].width"
                              align="center"
                            >
                              <template slot-scope="scope">
                                <el-input
                                  v-model="scope.row.exposuretotal"
                                  type="text"
                                  readonly
                                ></el-input>
                              </template>
                            </el-table-column>
                            <el-table-column
                              :key="RadiationemploymentcolumnList[8].prop"
                              :prop="RadiationemploymentcolumnList[8].prop"
                              :label="RadiationemploymentcolumnList[8].label"
                              :width="RadiationemploymentcolumnList[8].width"
                              align="center"
                            >
                              <template slot-scope="scope">
                                <el-input
                                  v-model="scope.row.exposureexcess"
                                  type="text"
                                  readonly
                                ></el-input>
                              </template>
                            </el-table-column>
                          </el-table>
                        </el-tab-pane>
                        <el-tab-pane label="放射史其他" name="five">
                          <div class="button-container" align="right">
                            <el-row>
                              <el-col :span="24" class="grid-cell">
                                <el-form-item
                                  label="配偶接触放射情况"
                                  prop="personal"
                                  class="label-right-align"
                                  label-width="140px"
                                >
                                  <el-input
                                    v-model="inquiryDto.inquiryradiationother.spouseradiation"
                                    size="mini"
                                    type="text"
                                    readonly
                                  ></el-input>
                                </el-form-item>

                                <el-form-item
                                  label="配偶职业及健康状况"
                                  prop="personal"
                                  class="label-right-align"
                                  label-width="140px"
                                >
                                  <el-input
                                    v-model="inquiryDto.inquiryradiationother.spousehealth"
                                    size="mini"
                                    type="text"
                                    readonly
                                  ></el-input>
                                </el-form-item>

                                <el-form-item
                                  label="剂量检测单位"
                                  prop="personal"
                                  class="label-right-align"
                                  label-width="140px"
                                >
                                  <el-input
                                    v-model="inquiryDto.inquiryradiationother.radiationdetection"
                                    size="mini"
                                    type="text"
                                    readonly
                                  ></el-input>
                                </el-form-item>

                                <el-form-item
                                  label="知识培训单位"
                                  prop="personal"
                                  class="label-right-align"
                                  label-width="140px"
                                >
                                  <el-input
                                    v-model="inquiryDto.inquiryradiationother.trainingorg"
                                    size="mini"
                                    type="text"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                            </el-row>
                          </div>
                        </el-tab-pane>
                      </div>
                    </el-tabs>
                  </el-row>
                  <!-- 个人史 -->
                  <el-row style="margin:0 10px 0px 8px">
                    <el-form :model="inquiryDto" label-position="right" label-width="80px"
                             size="mini">
                      <el-tabs v-model="PersonalName">
                        <el-tab-pane label="个人史" name="first">
                          <el-row style="margin-bottom: 4px">
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="吸烟情况"
                                class="label-right-align"
                              >
                                <el-select
                                  v-model="inquiryDto.inquiryitems.smoke"
                                  style="width: 90%"
                                  disabled
                                  size="mini"
                                >
                                  <el-option
                                    v-for="dict in dict.type.dime_physical_somke"
                                    :key="dict.value"
                                    :label="dict.label"
                                    :value="dict.value"
                                  ></el-option>
                                </el-select>
                              </el-form-item>
                            </el-col>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="吸烟量(支)"
                                label-width="90px"
                              >
                                <el-input
                                  style="width: 90%"
                                  v-model="inquiryDto.inquiryitems.smokequantity"
                                  type="text"
                                  readonly
                                  size="mini"
                                  suffix-icon="支/天"
                                >
                                </el-input>
                              </el-form-item>
                            </el-col>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="烟龄(年)"
                                style="width: 90%"
                              >
                                <el-input v-model="inquiryDto.inquiryitems.smokeyears" readonly size="mini"></el-input>
                              </el-form-item>
                            </el-col>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="烟龄(月)"
                              >
                                <el-input v-model="inquiryDto.inquiryitems.smokemonths" readonly  size="mini"></el-input>
                              </el-form-item>
                            </el-col>
                          </el-row>
                          <el-row>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="饮酒情况"
                              >
                                <el-select
                                  v-model="inquiryDto.inquiryitems.drink"
                                  style="width: 90%"
                                  disabled
                                  size="mini"
                                >
                                  <el-option
                                    v-for="dict in dict.type.dime_physical_drink"
                                    :key="dict.value"
                                    :label="dict.label"
                                    :value="dict.value"
                                  ></el-option>
                                </el-select>
                              </el-form-item>
                            </el-col>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="饮酒量(ml)"
                                label-width="90px"
                                class="label-right-align"
                              >
                                <el-input
                                  v-model="inquiryDto.inquiryitems.drinkquantity"
                                  type="text"
                                  style="width: 90%"
                                  size="mini"
                                  readonly
                                ></el-input>
                              </el-form-item>
                            </el-col>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="酒龄(年)"
                                style="width: 90%"
                                class="label-right-align"
                              >
                                <el-input v-model="inquiryDto.inquiryitems.drinkyears" readonly  size="mini"></el-input>
                              </el-form-item>
                            </el-col>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="酒龄(月)"
                                class="label-right-align"
                              >
                                <el-input v-model="inquiryDto.inquiryitems.drinkmonths" readonly  size="mini"></el-input>
                              </el-form-item>
                            </el-col>
                          </el-row>
                          <el-row>
                            <el-col :span="12" class="grid-cell">
                              <el-form-item
                                label="个人史"
                              >
                                <el-input
                                  v-model="inquiryDto.inquiryitems.personal" readonly
                                  type="text"
                                  size="mini"
                                ></el-input>
                              </el-form-item>
                            </el-col>
                            <el-col :span="12">
                              <el-form-item label="家族病史" prop="family">
                                <el-input
                                  v-model="inquiryDto.inquiryitems.family"
                                  type="text"
                                  readonly
                                  size="mini"
                                ></el-input>
                              </el-form-item>
                            </el-col>
                            <el-col :span="24">
                              <el-form-item label="其他" prop="other">
                                <el-input
                                  v-model="inquiryDto.inquiryitems.other"
                                  type="text"
                                  readonly
                                  size="mini"
                                ></el-input>
                              </el-form-item>
                            </el-col>
                          </el-row>
                          <div v-show="inquiryDto.sex=='FEMALE'">
                            <div class="static-content-item">
                              <el-divider direction="horizontal">女性</el-divider>
                            </div>
                            <el-row>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="初潮(岁)"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="inquiryDto.inquiryitems.menstrbegin"
                                    size="mini"
                                    type="text"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="经期(天)"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="inquiryDto.inquiryitems.menstrlen"
                                    size="mini"
                                    type="text"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="周期(天)"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="inquiryDto.inquiryitems.menstrcycle"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="停经(岁)"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="inquiryDto.inquiryitems.menstrend"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="经期"
                                  class="label-right-align"
                                >
                                  <el-radio-group
                                    v-model="inquiryDto.inquiryitems.menstrcome"
                                  >
                                    <el-radio
                                      v-for="(item, index) in menstrcomeOptions"
                                      :key="index"
                                      :label="item.value"
                                      disabled
                                      style=" {display: inline;}"
                                    >{{ item.label }}</el-radio
                                    >
                                  </el-radio-group>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell"> </el-col>
                            </el-row>
                            <el-row>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="子女数"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="inquiryDto.inquiryitems.childrencount"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="流产胎次"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="inquiryDto.inquiryitems.abortiontimes"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="早产胎次"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="inquiryDto.inquiryitems.prematuretimes"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="死产胎次"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="inquiryDto.inquiryitems.reproducedied"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="异产胎次"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="inquiryDto.inquiryitems.mostercount"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell"> </el-col>
                            </el-row>
                            <el-row>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="孕次"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="inquiryDto.inquiryitems.graviditycount"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="活产胎次"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="inquiryDto.inquiryitems.livebrithcount"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="畸胎"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="inquiryDto.inquiryitems.teratomacount"
                                    type="text"
                                    readonly
                                    size="mini"
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="多胎"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="inquiryDto.inquiryitems.mostcount"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="异位妊娠"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="inquiryDto.inquiryitems.eccyesiscount"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell"> </el-col>
                            </el-row>
                            <el-row>
                              <el-col>
                                <el-form-item
                                  label="不孕不育情况"
                                  class="label-right-align"
                                  label-width="100px"
                                >
                                  <el-input
                                    v-model="inquiryDto.inquiryitems.infertility"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                            </el-row>
                          </div>
                          <el-row>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="男孩"
                              >
                                <el-input
                                  v-model="inquiryDto.inquiryitems.boys"
                                  type="text"
                                  size="mini"
                                  readonly
                                ></el-input>
                              </el-form-item>
                            </el-col>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="出生日期"
                              >
                                <el-date-picker
                                  v-model="inquiryDto.inquiryitems.boybrithdays"
                                  type="date"
                                  size="mini"
                                  style="width:100%"
                                  readonly
                                  value-format="yyyy-MM-dd">
                                </el-date-picker>
                              </el-form-item>
                            </el-col>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="女孩"
                              >
                                <el-input
                                  v-model="inquiryDto.inquiryitems.girls"
                                  type="text"
                                  size="mini"
                                  readonly
                                ></el-input>
                              </el-form-item>
                            </el-col>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="出生日期"
                              >
                                <el-date-picker
                                  v-model="inquiryDto.inquiryitems.girlbrithdays"
                                  type="date"
                                  size="mini"
                                  style="width:100%"
                                  readonly
                                  value-format="yyyy-MM-dd">
                                </el-date-picker>
                              </el-form-item>
                            </el-col>
                          </el-row>
                          <el-row>
                            <el-col :span="24" class="grid-cell">
                              <el-form-item
                                label="子女健康情况"
                                label-width="100px"
                              >
                                <el-input
                                  v-model="inquiryDto.inquiryitems.childhealth"
                                  type="text"
                                  size="mini"
                                  readonly
                                ></el-input>
                              </el-form-item>
                            </el-col>
                          </el-row>
                          <el-row>
                            <el-col :span="12">
                              <el-form-item
                                label="现患疾病"
                                class="label-right-align"
                              >
                                <el-select
                                  v-model="inquiryDto.inquirycurrentdiseases"
                                  multiple
                                  disabled
                                  allow-create
                                >
                                  <el-option
                                    v-for="item in Diseasesoptions"
                                    :key="item.id"
                                    :label="item.dKey"
                                    :value="item.id"
                                  >
                                  </el-option>
                                </el-select>
                              </el-form-item>
                            </el-col>
                            <el-col :span="12">
                              <el-form-item
                                label="症状"
                              >
                                <el-select
                                  v-model="inquiryDto.inquirysymptom"
                                  multiple
                                  disabled
                                >
                                  <el-option
                                    v-for="item in symptomoptions"
                                    :key="item.id"
                                    :label="item.symptomName"
                                    :value="item.id"
                                  >
                                  </el-option>
                                </el-select>
                              </el-form-item>
                            </el-col>
                          </el-row>
                        </el-tab-pane>

                        <el-tab-pane label="签名" name="second">
                          <el-form-item
                            label="签名"
                            class="label-right-align"
                          >
                            <div v-if="inquiryDto.inquirysign.signsoure">
                              <img :src="inquiryDto.inquirysign.signsoure">
                            </div>
                            <div v-else>暂无签名</div>
                          </el-form-item>
                        </el-tab-pane>
                      </el-tabs>
                    </el-form>
                  </el-row>
                </el-tab-pane>
                <el-tab-pane label="历史撤销原因" name="four" v-if="choosedPersonInfo.mainCheckRevoke>0">
                  <el-row>
                    <el-col :span="18">
                      <el-form :model="choosedPersonInfo" label-position="right" label-width="100px">
                        <el-form-item
                          label="历史撤销原因"
                        >
                          <el-input
                            v-model="choosedPersonInfo.mainCheckRevokeMark"
                            type="textarea"
                            :rows="12"
                            readonly
                          ></el-input>
                        </el-form-item>
                      </el-form>
                    </el-col>
                  </el-row>
                </el-tab-pane>
              </el-tabs>
            </el-row>
          </el-col>
        </el-row>

      </el-form>

      <el-dialog
        :visible.sync="dialogHealthAdvice"
        :close-on-click-modal="false"
        title="健康建议"
        @close="cancel()"
      >
        <el-input
          style="margin-bottom: 10px"
          placeholder="输入关键字进行过滤"
          v-model="filterText">
        </el-input>
        <div style="max-height: 500px;overflow-y: auto">
          <el-tree ref="healthAdviceRef"
            class="filter-tree"
            :data="depthealthadvices"
            :props="defaultProps"
            node-key="id"
            default-expand-all
            show-checkbox
            :filter-node-method="filterNode"
            :default-checked-keys="healthAdviceIds"
            >
          </el-tree>
        </div>

        <div align="right" style="margin-top:20px">
          <el-button size="medium" type="text" @click="clearAdvce"
          >重置</el-button
          >
          <el-button
            size="medium"
            type="primary"
            @click="SaveSelectHealthAdvce"
          >确认</el-button
          >
        </div>
      </el-dialog>
      <el-dialog
        :visible.sync="dialogSearch"
        title="更多搜索条件"
        @close="cancel()"
        width="650px"
      >
        <el-form :model="searchParams" ref="searchForm" label-position="right" label-width="80px">
          <el-row>
            <el-col :span="12">
              <el-form-item label="体检编号" prop="checkCode">
                <el-input
                  v-model="searchParams.checkCode"
                  placeholder="请输入体检编号"
                  clearable
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="体检状态" prop="completStatus">
                <el-select v-model="searchParams.completStatus" clearable placeholder="请选择体检状态">
                  <el-option
                    v-for="dict in dict.type.dime_physical_completstatus"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-form-item label="登记日期" prop="registerDate">
            <el-date-picker
              style="width: 100%"
              v-model="registerDate"
              type="daterange"
              value-format="yyyy-MM-dd"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="体检日期" prop="physicalDate">
            <el-date-picker
              style="width: 100%"
              v-model="physicalDate"
              type="daterange"
              value-format="yyyy-MM-dd"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="主检日期" prop="maincheckDate">
            <el-date-picker
              style="width: 100%"
              v-model="maincheckDate"
              type="daterange"
              value-format="yyyy-MM-dd"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="单位名称" prop="companyName">
            <el-input
              v-model="searchParams.companyName"
              placeholder="请输入单位名称"
              clearable
            />
          </el-form-item>
          <el-row>
            <el-col :span="12">
              <el-form-item label="体检类型" prop="checkType">
                <el-select v-model="searchParams.checkType" placeholder="请选择体检类型">
                  <el-option
                    v-for="dict in dict.type.dime_physical_type"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="在岗状态" prop="workStatus">
                <el-select v-model="searchParams.workStatus" placeholder="请选择在岗状态" clearable>
                  <el-option
                    v-for="dict in dict.type.dime_physical_work"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                  />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>

        <div align="right" style="margin-top:20px">
          <el-button icon="el-icon-refresh" size="medium" @click="resetSearch"
          >重置</el-button
          >
          <el-button
            icon="el-icon-search"
            size="medium"
            type="primary"
            @click="handleSearch"
          >确认</el-button
          >
        </div>
      </el-dialog>
      <el-dialog
        :visible.sync="dialogHarm"
        title="选择危害"
        @close="closeHarm"
        width="500px"
      >
        <el-table
          ref="harmTable"
          border
          stripe
          :data="form.maincheckHarmDtoList"
          size="small"
          height="350px"
          @selection-change="handleHarmChange"
        >
          <el-table-column type="selection" width="55" align="center" />
          <el-table-column label="危害名称" align="center" prop="baseHarmName" />
        </el-table>

        <div align="right" style="margin-top:20px">
          <el-button
            type="primary"
            @click="confirmHarm"
          >确认</el-button
          >
        </div>
      </el-dialog>
      <el-dialog
          :visible.sync="dialogPicture"
          title="查看图文"
          width="1000px"
        >
          <el-tabs v-model="groups">
            <el-tab-pane
              v-for="(item,index) in pictureList"
              :label="item.groupName"
              :name="String(item.groupName)"
              :key="index"
            >
              <div style="max-height: 90vh;overflow-y: auto">
                <img v-for="(pic,index) in item.picUrl" :src="pic" :key="index" style="max-width:100%">
              </div>
            </el-tab-pane>
          </el-tabs>
        </el-dialog>
      <el-dialog
        :visible.sync="dialogHistory"
        title="查看历史"
        width="1000px"
      >
        <el-tabs v-model="historyName">
          <el-tab-pane
            v-for="(item,index) in historyList"
            :label="item.checkDate"
            :name="String(item.checkDate)"
            :key="index"
          >
            <div style="max-height: 90vh;overflow-y: auto">
              <el-descriptions title="基础信息" :column="4">
                <el-descriptions-item label="体检编号">{{item.checkCode}}</el-descriptions-item>
                <el-descriptions-item label="姓名">{{item.name}}</el-descriptions-item>
                <el-descriptions-item label="性别"><dict-tag :options="dict.type.sys_user_sex" :value="item.sex"/></el-descriptions-item>
                <el-descriptions-item label="年龄">{{item.age}}</el-descriptions-item>
                <el-descriptions-item label="总工龄">{{item.workYears}}年{{item.workMonths}}个月</el-descriptions-item>
                <el-descriptions-item label="接害工龄">{{item.touchYears}}年{{item.touchMonths}}个月</el-descriptions-item>
                <el-descriptions-item label="单位名称" :span="2">{{item.companyName}}</el-descriptions-item>
                <el-descriptions-item label="危害因素" :span="2">{{item.touchHarms}}</el-descriptions-item>
                <el-descriptions-item label="体检类型"><dict-tag :options="dict.type.dime_physical_type" :value="item.checkType"/></el-descriptions-item>
                <el-descriptions-item label="在岗状态">
                  <dict-tag :options="dict.type.dime_physical_work" :value="item.workStatus"/>
                </el-descriptions-item>
                <el-descriptions-item label="体检套餐" :span="2">{{item.packageName}}</el-descriptions-item>
                <el-descriptions-item label="部门">{{item.dept}}</el-descriptions-item>
                <el-descriptions-item label="工种">{{item.jobType}}</el-descriptions-item>
              </el-descriptions>
              <el-tabs v-model="tabName" type="border-card">
                <el-tab-pane label="体检结果" name="first">
                  <el-row :gutter="10">
                    <el-col :span="6">
                      <el-divider content-position="left"
                      >当前科室</el-divider>
                      <el-table size="small" :data="item.registerflowViewDtoList" border max-height="500px" @row-click="handleClickGroup" :highlight-current-row=true>
                        <el-table-column label="科室名称" align="center" prop="groupName" width="120px"/>
                        <el-table-column label="状态" align="center" prop="flowStatus">
                          <template slot-scope="scope">
                            <span :style="{color:(scope.row.flowStatus== 0 ? 'red' : 'green')}">{{scope.row.flowStatus== 0 ? '未完成' : '已完成'}}</span>
                          </template>
                        </el-table-column>
                      </el-table>
                    </el-col>
                    <el-col :span="18">
                      <el-divider content-position="left"
                      >细项结果</el-divider>
                      <el-table size="small" :data="combList" border max-height="450px">
                        <el-table-column label="检查项目" align="center" prop="itemName" width="160px"/>
                        <el-table-column label="检查结果" align="center" prop="result" width="160px"/>
                        <el-table-column label="合格" align="center" prop="passTag">
                          <template scope="scope">
                            <el-checkbox v-model="scope.row.passTag" :true-label="1" :false-label="0"
                            ></el-checkbox
                            >
                          </template>
                        </el-table-column>
                        <el-table-column label="缺检" align="center" prop="lack">
                          <template scope="scope">
                            <el-checkbox v-model="scope.row.lack" true-label="true" false-label="false"
                            ></el-checkbox
                            >
                          </template>
                        </el-table-column>
                        <el-table-column label="标准值" align="center" prop="valDefault" />
                        <el-table-column label="特殊标准值" align="center" prop="specialitem" />
                      </el-table>
                      <div class="conclusion">
                        <div style=" white-space: nowrap;">小结：</div>
                        <el-input v-model="conclusion" readonly></el-input>
                      </div>
                    </el-col>
                  </el-row>
                </el-tab-pane>
                <el-tab-pane label="问诊" name="second">
                  <!-- 职业史 -->
                  <el-row style="margin-left: 8px;margin-bottom:40px">
                    <el-tabs v-model="occupationName" style="height: 210px">
                      <el-tab-pane label="职业史" name="first">
                        <el-table
                          border
                          stripe
                          :data="item.inquiryHistoryDto.inquiryoccupations"
                          size="small"
                          height="160px"
                          style="width: 99%; margin-left: 4px"
                        >
                          <el-table-column type="index" label="No." :width="50" />
                          <el-table-column
                            :key="EmploymentcolumnList[0].prop"
                            :prop="EmploymentcolumnList[0].prop"
                            :label="EmploymentcolumnList[0].label"
                            :width="EmploymentcolumnList[0].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-date-picker
                                is-range
                                v-model="scope.row.datefromto"
                                type="daterange"
                                class="full-width-input"
                                format="yyyy-MM-dd"
                                value-format="yyyy-MM-dd"
                                readonly
                                style="width: 240px"
                              ></el-date-picker>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="EmploymentcolumnList[1].prop"
                            :prop="EmploymentcolumnList[1].prop"
                            :label="EmploymentcolumnList[1].label"
                            :width="EmploymentcolumnList[1].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.company"
                                type="text"
                                readonly
                              ></el-input>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="EmploymentcolumnList[2].prop"
                            :prop="EmploymentcolumnList[2].prop"
                            :label="EmploymentcolumnList[2].label"
                            :width="EmploymentcolumnList[2].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.workshop"
                                type="text"
                                readonly
                              ></el-input>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="EmploymentcolumnList[3].prop"
                            :prop="EmploymentcolumnList[3].prop"
                            :label="EmploymentcolumnList[3].label"
                            :width="EmploymentcolumnList[3].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.occupationtype"
                                type="text"
                                readonly
                              ></el-input>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="EmploymentcolumnList[4].prop"
                            :prop="EmploymentcolumnList[4].prop"
                            :label="EmploymentcolumnList[4].label"
                            :width="EmploymentcolumnList[4].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.harmfactor"
                                type="text"
                                readonly
                              ></el-input>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="EmploymentcolumnList[5].prop"
                            :prop="EmploymentcolumnList[5].prop"
                            :label="EmploymentcolumnList[5].label"
                            :width="EmploymentcolumnList[5].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-select v-model="scope.row.protectmeasure" disabled>
                                <el-option
                                  v-for="dict in dict.type.dime_inquiry_protectmeasure"
                                  :key="dict.value"
                                  :label="dict.label"
                                  :value="dict.value"
                                ></el-option>
                              </el-select>
                            </template>
                          </el-table-column>
                        </el-table>
                      </el-tab-pane>

                      <el-tab-pane label="既往病史" name="second">
                        <el-table
                          border
                          stripe
                          :data="item.inquiryHistoryDto.inquirydisease"
                          size="small"
                          height="160px"
                          style="width: 99%; margin-left: 4px"
                        >
                          <el-table-column type="index" label="No." :width="50" />

                          <el-table-column
                            :key="medicalcolumnList[0].prop"
                            :prop="medicalcolumnList[0].prop"
                            :label="medicalcolumnList[0].label"
                            :width="medicalcolumnList[0].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.diseaseName"
                                type="text"
                                readonly
                              ></el-input>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="medicalcolumnList[1].prop"
                            :prop="medicalcolumnList[1].prop"
                            :label="medicalcolumnList[1].label"
                            :width="medicalcolumnList[1].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-date-picker
                                v-model="scope.row.diagnoseDate"
                                type="date"
                                class="full-width-input"
                                format="yyyy-MM-dd"
                                value-format="yyyy-MM-dd"
                                readonly
                                style="width: 240px"
                              ></el-date-picker>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="medicalcolumnList[2].prop"
                            :prop="medicalcolumnList[2].prop"
                            :label="medicalcolumnList[2].label"
                            :width="medicalcolumnList[2].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.diagnosis"
                                type="text"
                                readonly
                              ></el-input>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="medicalcolumnList[3].prop"
                            :prop="medicalcolumnList[3].prop"
                            :label="medicalcolumnList[3].label"
                            :width="medicalcolumnList[3].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.treatment"
                                type="text"
                                readonly
                              ></el-input>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="medicalcolumnList[4].prop"
                            :prop="medicalcolumnList[4].prop"
                            :label="medicalcolumnList[4].label"
                            :width="medicalcolumnList[4].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.returnTo"
                                type="text"
                                readonly
                              ></el-input>
                            </template>
                          </el-table-column>
                        </el-table>
                      </el-tab-pane>

                      <el-tab-pane label="急慢性职业病史" name="thrid">
                        <el-table
                          ref="chronicmultipleTable"
                          border
                          stripe
                          :data="item.inquiryHistoryDto.inquirychronicoccupationalhistory"
                          size="small"
                          height="160px"
                          style="width: 99%; margin-left: 4px"
                        >
                          <el-table-column type="index" label="No." :width="50" />
                          <el-table-column
                            :key="chroniccolumnList[0].prop"
                            :prop="chroniccolumnList[0].prop"
                            :label="chroniccolumnList[0].label"
                            :width="chroniccolumnList[0].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.diseasName"
                                type="text"
                              ></el-input>
                            </template>
                          </el-table-column>

                          <el-table-column
                            :key="medicalcolumnList[1].prop"
                            :prop="medicalcolumnList[1].prop"
                            :label="medicalcolumnList[1].label"
                            :width="medicalcolumnList[1].width"
                            align="center"
                          >

                            <template slot-scope="scope">
                              <el-date-picker
                                v-model="scope.row.diagnosisdate"
                                type="date"
                                class="full-width-input"
                                format="yyyy-MM-dd"
                                value-format="yyyy-MM-dd"
                                clearable

                              ></el-date-picker>
                            </template>
                          </el-table-column>
                          <el-table-column
                            :key="chroniccolumnList[2].prop"
                            :prop="chroniccolumnList[2].prop"
                            :label="chroniccolumnList[2].label"
                            :width="chroniccolumnList[2].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-input
                                v-model="scope.row.company"
                                type="text"
                              ></el-input>
                            </template>
                          </el-table-column>
                          <el-table-column
                            :key="chroniccolumnList[3].prop"
                            :prop="chroniccolumnList[3].prop"
                            :label="chroniccolumnList[3].label"
                            :width="chroniccolumnList[3].width"
                            align="center"
                          >
                            <template slot-scope="scope">
                              <el-switch
                                v-model="scope.row.isheal"
                                active-color="#13ce66"
                                inactive-color="#ff4949"
                                active-value="1"
                                inactive-value="0"
                              >
                              </el-switch>
                            </template>
                          </el-table-column>
                        </el-table>
                      </el-tab-pane>
                      <div v-if="form.checkType!=='02'">
                        <el-tab-pane label="放射职业史" name="fourth">
                          <el-table
                            border
                            stripe
                            :data="item.inquiryHistoryDto.inquiryradiationoccupations"
                            size="small"
                            height="160px"
                            style="width: 99%; margin-left: 4px"
                          >
                            <el-table-column type="index" label="No." :width="50" />

                            <el-table-column
                              :key="RadiationemploymentcolumnList[0].prop"
                              :prop="RadiationemploymentcolumnList[0].prop"
                              :label="RadiationemploymentcolumnList[0].label"
                              :width="RadiationemploymentcolumnList[0].width"
                              align="center"
                            >
                              <template slot-scope="scope">
                                <el-date-picker
                                  is-range
                                  v-model="scope.row.datefromto"
                                  type="daterange"
                                  class="full-width-input"
                                  format="yyyy-MM-dd"
                                  value-format="yyyy-MM-dd"
                                  style="width: 240px"
                                  readonly
                                ></el-date-picker>
                              </template>
                            </el-table-column>

                            <el-table-column
                              :key="RadiationemploymentcolumnList[1].prop"
                              :prop="RadiationemploymentcolumnList[1].prop"
                              :label="RadiationemploymentcolumnList[1].label"
                              :width="RadiationemploymentcolumnList[1].width"
                              align="center"
                            >
                              <template slot-scope="scope">
                                <el-input
                                  v-model="scope.row.company"
                                  type="text"
                                  readonly
                                ></el-input>
                              </template>
                            </el-table-column>
                            <el-table-column
                              :key="RadiationemploymentcolumnList[2].prop"
                              :prop="RadiationemploymentcolumnList[2].prop"
                              :label="RadiationemploymentcolumnList[2].label"
                              :width="RadiationemploymentcolumnList[2].width"
                              align="center"
                            >
                              <template slot-scope="scope">
                                <el-input
                                  v-model="scope.row.workshop"
                                  type="text"
                                  readonly
                                ></el-input>
                              </template>
                            </el-table-column>
                            <el-table-column
                              :key="RadiationemploymentcolumnList[3].prop"
                              :prop="RadiationemploymentcolumnList[3].prop"
                              :label="RadiationemploymentcolumnList[3].label"
                              :width="RadiationemploymentcolumnList[3].width"
                              align="center"
                            >
                              <template slot-scope="scope">
                                <el-input
                                  v-model="scope.row.occupationtype"
                                  type="text"
                                  readonly
                                ></el-input>
                              </template>
                            </el-table-column>
                            <el-table-column
                              :key="RadiationemploymentcolumnList[4].prop"
                              :prop="RadiationemploymentcolumnList[4].prop"
                              :label="RadiationemploymentcolumnList[4].label"
                              :width="RadiationemploymentcolumnList[4].width"
                              align="center"
                            >
                              <template slot-scope="scope">
                                <el-input
                                  v-model="scope.row.occupationexposure"
                                  type="text"
                                  readonly
                                ></el-input>
                              </template>
                            </el-table-column>
                            <el-table-column
                              :key="RadiationemploymentcolumnList[5].prop"
                              :prop="RadiationemploymentcolumnList[5].prop"
                              :label="RadiationemploymentcolumnList[5].label"
                              :width="RadiationemploymentcolumnList[5].width"
                              align="center"
                            >
                              <template slot-scope="scope">
                                <el-input
                                  v-model="scope.row.radiationcategory"
                                  type="text"
                                  readonly
                                ></el-input>
                              </template>
                            </el-table-column>
                            <el-table-column
                              :key="RadiationemploymentcolumnList[6].prop"
                              :prop="RadiationemploymentcolumnList[6].prop"
                              :label="RadiationemploymentcolumnList[6].label"
                              :width="RadiationemploymentcolumnList[6].width"
                              align="center"
                            >
                              <template slot-scope="scope">
                                <el-input
                                  v-model="scope.row.workhours"
                                  type="text"
                                  readonly
                                ></el-input>
                              </template>
                            </el-table-column>
                            <el-table-column
                              :key="RadiationemploymentcolumnList[7].prop"
                              :prop="RadiationemploymentcolumnList[7].prop"
                              :label="RadiationemploymentcolumnList[7].label"
                              :width="RadiationemploymentcolumnList[7].width"
                              align="center"
                            >
                              <template slot-scope="scope">
                                <el-input
                                  v-model="scope.row.exposuretotal"
                                  type="text"
                                  readonly
                                ></el-input>
                              </template>
                            </el-table-column>
                            <el-table-column
                              :key="RadiationemploymentcolumnList[8].prop"
                              :prop="RadiationemploymentcolumnList[8].prop"
                              :label="RadiationemploymentcolumnList[8].label"
                              :width="RadiationemploymentcolumnList[8].width"
                              align="center"
                            >
                              <template slot-scope="scope">
                                <el-input
                                  v-model="scope.row.exposureexcess"
                                  type="text"
                                  readonly
                                ></el-input>
                              </template>
                            </el-table-column>
                          </el-table>
                        </el-tab-pane>
                        <el-tab-pane label="放射史其他" name="five">
                          <div class="button-container" align="right">
                            <el-row>
                              <el-col :span="24" class="grid-cell">
                                <el-form-item
                                  label="配偶接触放射情况"
                                  prop="personal"
                                  class="label-right-align"
                                  label-width="140px"
                                >
                                  <el-input
                                    v-model="item.inquiryHistoryDto.inquiryradiationother.spouseradiation"
                                    size="mini"
                                    type="text"
                                    readonly
                                  ></el-input>
                                </el-form-item>

                                <el-form-item
                                  label="配偶职业及健康状况"
                                  prop="personal"
                                  class="label-right-align"
                                  label-width="140px"
                                >
                                  <el-input
                                    v-model="item.inquiryHistoryDto.inquiryradiationother.spousehealth"
                                    size="mini"
                                    type="text"
                                    readonly
                                  ></el-input>
                                </el-form-item>

                                <el-form-item
                                  label="剂量检测单位"
                                  prop="personal"
                                  class="label-right-align"
                                  label-width="140px"
                                >
                                  <el-input
                                    v-model="item.inquiryHistoryDto.inquiryradiationother.radiationdetection"
                                    size="mini"
                                    type="text"
                                    readonly
                                  ></el-input>
                                </el-form-item>

                                <el-form-item
                                  label="知识培训单位"
                                  prop="personal"
                                  class="label-right-align"
                                  label-width="140px"
                                >
                                  <el-input
                                    v-model="item.inquiryHistoryDto.inquiryradiationother.trainingorg"
                                    size="mini"
                                    type="text"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                            </el-row>
                          </div>
                        </el-tab-pane>
                      </div>
                    </el-tabs>
                  </el-row>
                  <!-- 个人史 -->
                  <el-row style="margin:0 10px 0px 8px">
                    <el-form :model="item.inquiryHistoryDto" label-position="right" label-width="80px"
                             size="mini">
                     <el-tabs v-model="PersonalName">
                      <el-tab-pane label="个人史" name="first">
                          <el-row style="margin-bottom: 4px">
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="吸烟情况"
                                class="label-right-align"
                              >
                                <el-select
                                  v-model="item.inquiryHistoryDto.inquiryitems.smoke"
                                  style="width: 90%"
                                  disabled
                                  size="mini"
                                >
                                  <el-option
                                    v-for="dict in dict.type.dime_physical_somke"
                                    :key="dict.value"
                                    :label="dict.label"
                                    :value="dict.value"
                                  ></el-option>
                                </el-select>
                              </el-form-item>
                            </el-col>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="吸烟量(支)"
                                label-width="90px"
                              >
                                <el-input
                                  style="width: 90%"
                                  v-model="item.inquiryHistoryDto.inquiryitems.smokequantity"
                                  type="text"
                                  readonly
                                  size="mini"
                                  suffix-icon="支/天"
                                >
                                </el-input>
                              </el-form-item>
                            </el-col>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="烟龄(年)"
                                style="width: 90%"
                              >
                                <el-input v-model="item.inquiryHistoryDto.inquiryitems.smokeyears" readonly size="mini"></el-input>
                              </el-form-item>
                            </el-col>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="烟龄(月)"
                              >
                                <el-input v-model="item.inquiryHistoryDto.inquiryitems.smokemonths" readonly  size="mini"></el-input>
                              </el-form-item>
                            </el-col>
                          </el-row>
                          <el-row>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="饮酒情况"
                              >
                                <el-select
                                  v-model="item.inquiryHistoryDto.inquiryitems.drink"
                                  style="width: 90%"
                                  disabled
                                  size="mini"
                                >
                                  <el-option
                                    v-for="dict in dict.type.dime_physical_drink"
                                    :key="dict.value"
                                    :label="dict.label"
                                    :value="dict.value"
                                  ></el-option>
                                </el-select>
                              </el-form-item>
                            </el-col>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="饮酒量(ml)"
                                label-width="90px"
                                class="label-right-align"
                              >
                                <el-input
                                  v-model="item.inquiryHistoryDto.inquiryitems.drinkquantity"
                                  type="text"
                                  style="width: 90%"
                                  size="mini"
                                  readonly
                                ></el-input>
                              </el-form-item>
                            </el-col>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="酒龄(年)"
                                style="width: 90%"
                                class="label-right-align"
                              >
                                <el-input v-model="item.inquiryHistoryDto.inquiryitems.drinkyears" readonly  size="mini"></el-input>
                              </el-form-item>
                            </el-col>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="酒龄(月)"
                                class="label-right-align"
                              >
                                <el-input v-model="item.inquiryHistoryDto.inquiryitems.drinkmonths" readonly  size="mini"></el-input>
                              </el-form-item>
                            </el-col>
                          </el-row>
                          <el-row>
                            <el-col :span="12" class="grid-cell">
                              <el-form-item
                                label="个人史"
                              >
                                <el-input
                                  v-model="item.inquiryHistoryDto.inquiryitems.personal" readonly
                                  type="text"
                                  size="mini"
                                ></el-input>
                              </el-form-item>
                            </el-col>
                            <el-col :span="12">
                              <el-form-item label="家族病史" prop="family">
                                <el-input
                                  v-model="item.inquiryHistoryDto.inquiryitems.family"
                                  type="text"
                                  readonly
                                  size="mini"
                                ></el-input>
                              </el-form-item>
                            </el-col>
                            <el-col :span="24">
                              <el-form-item label="其他" prop="other">
                                <el-input
                                  v-model="item.inquiryHistoryDto.inquiryitems.other"
                                  type="text"
                                  readonly
                                  size="mini"
                                ></el-input>
                              </el-form-item>
                            </el-col>
                          </el-row>
                          <div v-show="item.sex=='FEMALE'">
                            <div class="static-content-item">
                              <el-divider direction="horizontal">女性</el-divider>
                            </div>
                            <el-row>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="初潮(岁)"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="item.inquiryHistoryDto.inquiryitems.menstrbegin"
                                    size="mini"
                                    type="text"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="经期(天)"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="item.inquiryHistoryDto.inquiryitems.menstrlen"
                                    size="mini"
                                    type="text"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="周期(天)"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="item.inquiryHistoryDto.inquiryitems.menstrcycle"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="停经(岁)"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="item.inquiryHistoryDto.inquiryitems.menstrend"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="经期"
                                  class="label-right-align"
                                >
                                  <el-radio-group
                                    v-model="item.inquiryHistoryDto.inquiryitems.menstrcome"
                                  >
                                    <el-radio
                                      v-for="(item, index) in menstrcomeOptions"
                                      :key="index"
                                      :label="item.value"
                                      disabled
                                      style=" {display: inline;}"
                                    >{{ item.label }}</el-radio
                                    >
                                  </el-radio-group>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell"> </el-col>
                            </el-row>
                            <el-row>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="子女数"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="item.inquiryHistoryDto.inquiryitems.childrencount"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="流产胎次"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="item.inquiryHistoryDto.inquiryitems.abortiontimes"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="早产胎次"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="item.inquiryHistoryDto.inquiryitems.prematuretimes"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="死产胎次"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="item.inquiryHistoryDto.inquiryitems.reproducedied"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="异产胎次"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="item.inquiryHistoryDto.inquiryitems.mostercount"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell"> </el-col>
                            </el-row>
                            <el-row>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="孕次"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="item.inquiryHistoryDto.inquiryitems.graviditycount"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="活产胎次"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="item.inquiryHistoryDto.inquiryitems.livebrithcount"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="畸胎"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="item.inquiryHistoryDto.inquiryitems.teratomacount"
                                    type="text"
                                    readonly
                                    size="mini"
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="多胎"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="item.inquiryHistoryDto.inquiryitems.mostcount"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell">
                                <el-form-item
                                  label="异位妊娠"
                                  class="label-right-align"
                                >
                                  <el-input
                                    v-model="item.inquiryHistoryDto.inquiryitems.eccyesiscount"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                              <el-col :span="4" class="grid-cell"> </el-col>
                            </el-row>
                            <el-row>
                              <el-col>
                                <el-form-item
                                  label="不孕不育情况"
                                  class="label-right-align"
                                  label-width="100px"
                                >
                                  <el-input
                                    v-model="item.inquiryHistoryDto.inquiryitems.infertility"
                                    type="text"
                                    size="mini"
                                    readonly
                                  ></el-input>
                                </el-form-item>
                              </el-col>
                            </el-row>
                          </div>
                          <el-row>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="男孩"
                              >
                                <el-input
                                  v-model="item.inquiryHistoryDto.inquiryitems.boys"
                                  type="text"
                                  size="mini"
                                  readonly
                                ></el-input>
                              </el-form-item>
                            </el-col>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="出生日期"
                              >
                                <el-date-picker
                                  v-model="item.inquiryHistoryDto.inquiryitems.boybrithdays"
                                  type="date"
                                  size="mini"
                                  style="width:100%"
                                  readonly
                                  value-format="yyyy-MM-dd">
                                </el-date-picker>
                              </el-form-item>
                            </el-col>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="女孩"
                              >
                                <el-input
                                  v-model="item.inquiryHistoryDto.inquiryitems.girls"
                                  type="text"
                                  size="mini"
                                  readonly
                                ></el-input>
                              </el-form-item>
                            </el-col>
                            <el-col :span="6" class="grid-cell">
                              <el-form-item
                                label="出生日期"
                              >
                                <el-date-picker
                                  v-model="item.inquiryHistoryDto.inquiryitems.girlbrithdays"
                                  type="date"
                                  size="mini"
                                  style="width:100%"
                                  readonly
                                  value-format="yyyy-MM-dd">
                                </el-date-picker>
                              </el-form-item>
                            </el-col>
                          </el-row>
                          <el-row>
                            <el-col :span="24" class="grid-cell">
                              <el-form-item
                                label="子女健康情况"
                                label-width="100px"
                              >
                                <el-input
                                  v-model="item.inquiryHistoryDto.inquiryitems.childhealth"
                                  type="text"
                                  size="mini"
                                  readonly
                                ></el-input>
                              </el-form-item>
                            </el-col>
                          </el-row>
                          <el-row>
                            <el-col :span="12">
                              <el-form-item
                                label="现患疾病"
                                class="label-right-align"
                              >
                                <el-select
                                  v-model="item.inquiryHistoryDto.inquirycurrentdiseases"
                                  multiple
                                  disabled
                                  allow-create
                                >
                                  <el-option
                                    v-for="item in Diseasesoptions"
                                    :key="item.id"
                                    :label="item.dKey"
                                    :value="item.id"
                                  >
                                  </el-option>
                                </el-select>
                              </el-form-item>
                            </el-col>
                            <el-col :span="12">
                              <el-form-item
                                label="症状"
                              >
                                <el-select
                                  v-model="item.inquiryHistoryDto.inquirysymptom"
                                  multiple
                                  disabled
                                >
                                  <el-option
                                    v-for="item in symptomoptions"
                                    :key="item.id"
                                    :label="item.symptomName"
                                    :value="item.id"
                                  >
                                  </el-option>
                                </el-select>
                              </el-form-item>
                            </el-col>
                          </el-row>
                      </el-tab-pane>

                      <el-tab-pane label="签名" name="second">
                          <el-form-item
                            label="签名"
                            class="label-right-align"
                          >
                            <div v-if="item.inquiryHistoryDto.inquirysign.signsoure">
                              <img :src="item.inquiryHistoryDto.inquirysign.signsoure">
                            </div>
                            <div v-else>暂无签名</div>
                          </el-form-item>
                      </el-tab-pane>
                     </el-tabs>
                    </el-form>
                  </el-row>
                </el-tab-pane>
                <el-tab-pane label="结论及建议" name="third">
                  <el-row :gutter="20">
                    <el-col :span="12">
                      <el-divider content-position="left"
                      >检查结果</el-divider
                      >
                      <el-input
                        readonly
                        type="textarea"
                        :rows="6"
                        v-model="item.checkResult"
                      >
                      </el-input>
                    </el-col>
                    <el-col :span="12">
                      <el-divider content-position="left"
                      >建议</el-divider
                      >
                      <el-input
                        readonly
                        type="textarea"
                        :rows="6"
                        v-model="item.healthSuggestion"
                      >
                      </el-input>
                    </el-col>
                    <el-col :span="24">
                      <el-divider content-position="left"
                      >结论</el-divider
                      >
                      <el-input
                        readonly
                        v-model="item.dimeMaincheckconclusion.conclusion"
                      >
                      </el-input>
                    </el-col>
                    <el-col :span="24">
                      <el-divider content-position="left"
                      >危害结论</el-divider
                      >
                      <el-table
                        border
                        stripe
                        :data="item.mainCheckHistoryDto.dimeMaincheckharmconclusionList"
                        size="small"
                        height="160px"
                        style="width: 100%"
                      >
                        <el-table-column label="危害名称" align="center" prop="harmName" width="300px"/>
                        <el-table-column label="危害结论" align="center" prop="conclusion" />
                      </el-table>
                    </el-col>
                  </el-row>
                </el-tab-pane>
              </el-tabs>
            </div>
          </el-tab-pane>
        </el-tabs>
      </el-dialog>

    </div>
    <div style="display: flex;align-items: center;justify-content: space-between;margin-top: 20px" v-if="form.completStatus!== ''">
      <div>
        <el-button size="medium" type="danger" style="margin-right:10px" @click="lookPicture()"
        >查看图文</el-button
        >
        <el-button
          size="medium"
          type="primary"
          @click="lookHistory()"
        >查看历史</el-button
        >
      </div>
      <div>
        <el-button size="medium" type="text" @click="resetForm"
        >重置</el-button
        >

        <el-button size="medium" type="danger" @click="revokeForm" v-if="parseInt(form.completStatus)> 1&&parseInt(form.completStatus)!==3"
        >撤销</el-button
        >
        <el-button
          v-if="parseInt(form.completStatus)<= 1"
          v-loading="formLoading"
          size="medium"
          type="primary"
          @click="save"
        >确认</el-button
        >
      </div>
    </div>
  </div>
</template>
<script>
import TablecolumnList from "../tablecolumn.js";
import { getMainChecklist,getMainCheckByCheckcode,getSubmitMaincheckPhysical,getHistoryPhysical,
  getbasemaincheckconclusion,getbasemaincheckconclusionadvice,saveMaincheck,revokeMaincheck,getbasecomblist } from '@/api/physical/physicalmaincheck'
import { getBasediseaselist, getBasesymptomlist } from '@/api/physical/physicalinquiry'

const defaultForm = {
  "address": "",
  "age": 0,
  "baseCompanyId": "",
  "basePackageId": "",
  "birthday": "",
  "channel": "",
  "checkCode": "",
  "checkDate": "",
  "checkResult": "",
  "checkType": "",
  "combLack": "",
  "companyName": "",
  "completStatus": "",
  "dept": "",
  "dimeMaincheckconclusion": {
    "abbreviation": "",
    "abnormalresult": "",
    "conclusion": "",
    "conclusionId": "",
    "conclusionadvice": "",
    "contraindicationTag": "",
    "focusTag": "",
    "healthDesc": "",
    "id": "",
    "isValid": 0,
    "occupationalTag": "",
    "otherTag": "",
    "params": {},
    "passTag": 0,
    "physicalRegisterId": "",
    "recheckTag": "",
    "remark": "",
    "sn": 0,
  },
  "dimeMaincheckhealthadviceList": [
    {
      "advicedescribe": "",
      "healthadvice": "",
      "healthadviceId": "",
      "id": "",
      "params": {},
      "physicalRegisterId": "",
      "remark": "",
    }
  ],
  "abnormalDimePhysicalitems":[],
  "dimeMaincheckotherdisease": {
    "id": "",
    "otherdiseaId": "",
    "otherdiseaName": "",
    "otherdiseaadvice": "",
    "params": {},
    "physicalRegisterId": "",
    "remark": "",
  },
  "empNo": "",
  "harmfacter": "",
  "headUrl": "",
  "headpicture": "",
  "healthSuggestion": "",
  "id": "",
  "idNo": "",
  "idNoType": "",
  "isValid": 0,
  "jobType": "",
  "lastCheckCode": "",
  "mainCheckDate": "",
  "mainCheckDoctor": "",
  "mainConclusion": "",
  "maincheckHarmDtoList": [
    {
      "baseHarmId": "",
      "baseHarmName": "危害名称",
      "conclusionId":'',
      "checkdisabled": true,
      "contraindicationsdisabled": true,
      "OCCDiseasesdisabled": true,
      "otherdisabled": true,
      "showDec":true,
      "dimeMaincheckharmabnormalcombList": [
      ],
      "conclusionadviceList":[],
      "dimeMaincheckharmadvice": {
        "abbreviation": "",
        "conclusionId": "",
        "conclusionadvice": "",
        "conclusionadviceId": "",
        "contraindicationTag": "",
        "focusTag": "",
        "harmId": "",
        "harmName": "",
        "id": "",
        "occupationalTag": "",
        "otherTag": "",
        "params": {},
        "passTag": 0,
        "physicalRegisterId": "",
        "recheckTag": "",
        "remark": "",
      },
      "dimeMaincheckharmconclusion": {
        "abbreviation": "",
        "abnormaldesc": "",
        "advicedescribe": "",
        "conclusion": "",
        "conclusionId": "",
        "contraindicationTag": "",
        "harmId": "",
        "harmName": "",
        "id": "",
        "occupationalTag": "",
        "otherTag": "",
        "params": {},
        "passTag": 0,
        "physicalRegisterId": "",
        "recheckTag": "",
        "remark": "",
      },
      "dimeMaincheckharmcontraindicationList": [

      ],
      "dimeMaincheckharmoccupationaldiseaeList": [

      ],
      "harmotherdisease": "",
      "dimeMaincheckharmotherdiseaseList": [],
      "dimeMaincheckharmrecheckcombList": [],
      "id": "",
      "params": {},
      "physicalRegisterId": "",
      "remark": "",
    }
  ],
  "marriage": "",
  "name": "",
  "nation": "",
  "nationality": "",
  "needAsk": "",
  "packageName": "",
  "params": {},
  "password": "",
  "personType": "",
  "phone": "",
  "platformTag": "",
  "reCheckTag": "",
  "registerDate": "",
  "remark": "",
  "reportPrintDate": "",
  "reportPrinter": "",
  "serviceUid": "",
  "sex": "",
  "shopCode": "",
  "soaOrderNo": "",
  "socialCode": "",
  "takeReportType": "",
  "touchHarms": "",
  "touchMonths": 0,
  "touchYears": 0,
  "workMonths": 0,
  "workStatus": "",
  "workYears": 0
};

export default {
  dicts: ['sys_user_sex','dime_physical_work','dime_physical_type','dime_physical_completstatus','dime_physical_somke','dime_physical_drink'],
  components: { },
  name: "Maincheck",
  props: {},

  data() {
    return {
      menstrcomeOptions: [
        {
          value: 0,
          label: "是",
        },
        {
          label: "否",
          value: 1,
        },
      ],
      bianquehealthDesc:'',
      Diseasesoptions:[],
      symptomoptions:[],
      combList:[],
      conclusion:'',
      historyList:null,
      pictureList:[],
      dialogPicture:false,
      dialogHistory:false,
      choosedotherdiseaselist:[],
      otherdiseaseTag:0,
      otherdiseaselist:[],
      normalOptionId: null, //正常选项id
      otherOptionId: null, //其他选项id
      choosedHarm:[],
      maincheckHarmViewDtoList:[],
      dialogHarm:false,
      registerDate:'',
      physicalDate:'',
      maincheckDate:'',
      searchParams:{
        completStatus:'',
        checkCode:'',
        registerbegineDate:'',
        registerendDate:'',
        physicalbegineDate:'',
        physicalendDate:'',
        maincheckbegineDate:'',
        maincheckendDate:'',
        companyName:'',
        checkType:'',
        workStatus:''
      },
      choosedPersonInfo:{},
      filterText: '',
      defaultProps: {
        children: 'dimeBasehealthadviceList',
        label: 'label'
      },
      baseHealthadvices:[],
      loading:false,
      checkResultLists:[],
      inquiryDto:null,
      comblists:[],
      showCon:true,
      form: Object.assign({}, defaultForm),
      DataPersonlist: [],
      SubDatalist: [],
      dialogHealthAdvice: false,
      dialogSearch: false,
      formTitle: "",
      EntryDataData: [],
      Personlist: TablecolumnList.Personlist,
      mainSubscolumnLit: TablecolumnList.mainSubscolumnLit,
      mainHarmcombolumnLit: TablecolumnList.mainHarmcombolumnLit,
      EmploymentcolumnList: TablecolumnList.EmploymentcolumnList,
      medicalcolumnList: TablecolumnList.medicalcolumnList,
      RadiationemploymentcolumnList: TablecolumnList.RadiationemploymentcolumnList,
      chroniccolumnList: TablecolumnList.chroniccolumnList,
      rules: {},
      activeName: "first",
      occupationName: "first",
      PersonalName: "first",
      harms: "first",
      groups: "first",
      historyName: "first",
      tabName: "first",
      conclusionoptions: [],
      baseconclusion: [],
      harmrecheckcomboptions: [],
      consiondec: [],
      consiondecoptions: [],
      SelectConsionAdvice: [],
      SelectHealthAdvce: [],
      healthAdviceIds: [],
      depthealthadvices: [],
      conclusionadvices: [],
      formLoading: false,
      multipleSelection: [],
    };
  },
  computed: {

  },
  watch: {
    filterText(val) {
      this.$refs.healthAdviceRef.filter(val);
    }
  },
  created() {
    this.InitCheckMainData()
  },
  mounted() {},
  methods: {
    forceUpdate() {
      this.$forceUpdate()
    },
    BulidAbnormalDesc(ele){
      this.$forceUpdate();
      if(ele.dimeMaincheckharmabnormalcombList && ele.dimeMaincheckharmabnormalcombList.length>0) {
        let groupConsion = ''
        ele.dimeMaincheckharmabnormalcombList.forEach(
          item => {
            groupConsion += item.groupConsion + '；'
          }
        )
        this.$set(ele.dimeMaincheckharmconclusion, 'abnormaldesc', groupConsion)
      }
      if(ele.dimeMaincheckharmabnormalcombList&&ele.checkdisabled == false){
        ele.dimeMaincheckharmrecheckcombIds=ele.dimeMaincheckharmabnormalcombList.map((x) => {
          return x.combId
        })
      }
      this.Recheckcombchange(ele.dimeMaincheckharmrecheckcombIds,ele)
    },
    handleClickGroup(val){
      this.combList=val.dimePhysicalitemsList
      if(val.dimePhysicalconsion){
        this.conclusion=val.dimePhysicalconsion.conclusion
      }else{
        this.conclusion=''
      }
    },
    lookPicture(){
     this.dialogPicture=true
    },
    lookHistory(){
      this.loading=true
      getHistoryPhysical(this.choosedPersonInfo).then(response => {
        response.data.forEach(item=>{
          item.inquiryHistoryDto = item.inquiryHistoryDto || {}
          item.inquiryHistoryDto.inquiryoccupations = item.inquiryHistoryDto.inquiryoccupations || []
          item.inquiryHistoryDto.inquiryitems = item.inquiryHistoryDto.inquiryitems || {}
          item.inquiryHistoryDto.inquirysign = item.inquiryHistoryDto.inquirysign || {}
          if(item.inquiryHistoryDto.inquirysymptom){
            item.inquiryHistoryDto.inquirysymptom = item.inquiryHistoryDto.inquirysymptom.map(item=>{
              return item.symptomId
            })
          }
        })
        this.historyList = response.data;
        if(response.data&&response.data.length > 0){
        this.historyName=response.data[0].checkDate
        }
        this.dialogHistory=true
      }).finally(()=>{
        this.loading=false
      });
    },
    BulidDiseaseAdvice(){
      if(this.form.abnormalDimePhysicalitems.length==0){
        this.$message({
          message: "请选择其他疾病和异常",
          type: "warning",
        });
        return;
      }
      let groupconsion = ''
      this.form.abnormalDimePhysicalitems.forEach(
        item => {
          groupconsion+= item.groupName + '：'+ (item.groupconsion || '')+ '；'
        }
      )
      this.form.dimeMaincheckotherdisease.otherdiseaadvice = groupconsion
    },
    closeHarm(){
      this.dialogHarm=false
    },
    confirmHarm(){
      if (!this.choosedHarm|| this.choosedHarm.length == 0) {
        this.$message({
          message: "请选择危害",
          type: "warning",
        });
        return;
      }
      this.form.maincheckHarmDtoList.forEach(item=>{
        for(let i = 0; i < this.choosedHarm.length; i++) {
          if(item.id == this.choosedHarm[i].id) return
        }
        item.conclusionId = this.otherOptionId
        this.HarmMainConsionChange(item.conclusionId, item)
      })
      this.choosedHarm.forEach(item=>{
        item.conclusionId = this.form.dimeMaincheckconclusion.conclusionId
        this.HarmMainConsionChange(item.conclusionId, item)
      })
      this.dialogHarm = false
    },
    resetSearch() {
      this.registerDate='',
      this.physicalDate='',
      this.maincheckDate='',
      this.searchParams={
        checkCode:'',
        registerbegineDate:'',
        registerendDate:'',
        physicalbegineDate:'',
        physicalendDate:'',
        maincheckbegineDate:'',
        maincheckendDate:'',
        companyName:'',
        checkType:'',
        workStatus:''
      }
    },
    handleSearch(){
      this.searchParams.registerbegineDate=this.registerDate[0]
      this.searchParams.registerendDate=this.registerDate[1]
      this.searchParams.physicalbegineDate=this.physicalDate[0]
      this.searchParams.physicalendDate=this.physicalDate[1]
      this.searchParams.maincheckbegineDate=this.maincheckDate[0]
      this.searchParams.maincheckendDate=this.maincheckDate[1]
      this.loading=true
      getMainChecklist(this.searchParams).then(response => {
        this.DataPersonlist = response.data;
        this.dialogSearch=false
      }).finally(()=>{
        this.loading=false
      });
    },
    clearAdvce(){
      this.$refs.healthAdviceRef.setCheckedKeys([])
    },
    filterNode(value, data) {
      if (!value) return true;
      return data.label.indexOf(value) !== -1;
    },
    isTagRed(data) {
      let className = data.row.passTag == 0? 'red-row':''
      return className;
    },
    handleCurrentChange(val) {
      this.activeName='first'
      this.choosedPersonInfo=val
      this.loading=true
      this.form = Object.assign(defaultForm, val);
      getbasemaincheckconclusion({pageNum: 1,
        pageSize: 100,checkType:this.form.checkType,workStatus:this.form.workStatus}).then(conclusionRes => {
        this.conclusionoptions = conclusionRes.rows;
        this.conclusionoptions.forEach(item=>{
          if(item.passTag == 1) {
            this.normalOptionId = item.id
          }
          if(item.otherTag == 1) {
            this.otherOptionId = item.id
          }
        })
        this.showCon=false
        this.otherdiseaseTag=0
        getMainCheckByCheckcode(val).then(response => {
          this.form.dimeMaincheckotherdisease.otherdiseaadvice=''
          this.form.dimeMaincheckconclusion.conclusionadvice=''
          this.pictureList=response.data.physicalGroupPicDtoList
          if(response.data.physicalGroupPicDtoList&&response.data.physicalGroupPicDtoList.length > 0){
            this.groups = response.data.physicalGroupPicDtoList[0].groupName;
          }
          if(response.data.dimePhysicaladviceList){
            let bianquehealthDesc = ''
            response.data.dimePhysicaladviceList.forEach(item=>{
              item.healthAdvice ="※" + item.healthAdvice + ";" + (item.medicalScience || '')
              bianquehealthDesc += item.healthAdvice + ' \n'
            })
            this.bianquehealthDesc=bianquehealthDesc
          }
          this.checkResultLists=response.data.dimePhysicalitemsList
          if(response.data.inquiryDto.inquirysymptom){
            response.data.inquiryDto.inquirysymptom = response.data.inquiryDto.inquirysymptom.map(item=>{
              return item.symptomId
            })
          }
          response.data.inquiryDto.inquiryitems=response.data.inquiryDto.inquiryitems || {}
          this.inquiryDto=response.data.inquiryDto

          this.form.dimeMaincheckconclusion.abnormalresult=response.data.abnormalResults
          this.form.dimeMaincheckhealthadviceList=response.data.maincheckhealthadviceList
          this.form.dimeMaincheckconclusion.conclusionId=''
          this.otherdiseaselist=response.data.allabnormalitemsList
          if(response.data.basehealthDtoList){
            response.data.basehealthDtoList.forEach(item=>{
              item.id = item.groupid
              item.label = item.groupname
              item.dimeBasehealthadviceList.forEach(a=>{
                a.label = "※" + a.diseasename + "：" +a.processadvice
              })
            })
          }
          this.depthealthadvices=response.data.basehealthDtoList
          if(response.data.maincheckhealthadviceList){
            let healthDesc = ''
            response.data.maincheckhealthadviceList.forEach(item=>{
              item.processadvice ="※" + item.diseasename + "：" +item.processadvice
              healthDesc += item.processadvice + ' \n'
            })
            this.form.dimeMaincheckconclusion.healthDesc=healthDesc
            this.healthAdviceIds=response.data.maincheckhealthadviceList.map(item=>{
              return item.id
            })
          }
          this.maincheckHarmViewDtoList=response.data.maincheckHarmViewDtoList
          response.data.maincheckHarmViewDtoList.forEach(item=>{
            if(!item.dimeMaincheckharmconclusion) {
              item.dimeMaincheckharmconclusion = {}
              item.checkdisabled=true
              item.contraindicationsdisabled=true
              item.OCCDiseasesdisabled=true
              item.otherdisabled=true
              item.showDec=true
            }
            if(!item.dimeMaincheckharmadvice) {
              item.dimeMaincheckharmadvice = {}
            }
          })

          response.data.maincheckHarmViewDtoList.forEach((x) => {
            if(!x.dimeMaincheckharmadvice) {
              x.dimeMaincheckharmadvice = {}
            }
            if(x.dimeBasecombcriterionDtoList) {
              this.$set(x, 'dimeMaincheckharmabnormalcombList', x.dimeBasecombcriterionDtoList)
              x.dimeMaincheckharmabnormalcombList.forEach(com=>{
                this.$set(com, 'checked' ,true)
                this.$set(com, 'harmId' ,x.baseHarmId)
                this.$set(com, 'harmName' ,x.baseHarmName)
              })
            }
          });
          this.form.maincheckHarmDtoList = response.data.maincheckHarmViewDtoList
          this.harms = this.form.maincheckHarmDtoList[0].baseHarmName;
          if(parseInt(response.data.completStatus)>1){
            getSubmitMaincheckPhysical(val).then(res => {
              if(res.data){
                if(!res.data.dimeMaincheckotherdisease) {
                  res.data.dimeMaincheckotherdisease = {
                    otherdiseaadvice: ''
                  }
                }
               if(res.data.abnormalDimePhysicalitems&&res.data.abnormalDimePhysicalitems.length>0){
                 this.otherdiseaseTag=1
                 this.choosedotherdiseaselist=res.data.abnormalDimePhysicalitems
                 if(this.otherdiseaselist) {
                   let selectedRows = this.otherdiseaselist.filter(item=>{
                     for(let i = 0; i < this.choosedotherdiseaselist.length; i++) {
                       if(item.baseCombId == this.choosedotherdiseaselist[i].baseCombId) {
                         return true
                       }
                     }
                     return false
                   })
                   selectedRows.forEach(row=>{
                     this.$refs.otherdiseaseTable.toggleRowSelection(row, true)
                   })
                 }
               }
                res.data.maincheckHarmDtoList = res.data.maincheckHarmDtoList.filter(item=>{
                  return item.baseHarmId
                })
                res.data.maincheckHarmDtoList.forEach(item=>{
                  if(item.conclusionId){
                    this.setOptions(item.conclusionId, item)
                  }
                  if(item.dimeMaincheckharmcontraindicationList&&item.dimeMaincheckharmcontraindicationList.length>0){
                    item.dimeMaincheckharmcontraindicationIds=item.dimeMaincheckharmcontraindicationList.map(x=>{
                      return x.cationcriterionId
                    })
                  }
                  if(item.dimeMaincheckharmoccupationaldiseaeList&&item.dimeMaincheckharmoccupationaldiseaeList.length>0){
                    item.dimeMaincheckharmoccupationaldiseaeIds=item.dimeMaincheckharmoccupationaldiseaeList.map(x=>{
                      return x.occupationaldiseaeId
                    })
                  }

                  if(item.dimeMaincheckharmrecheckcombList&&item.dimeMaincheckharmrecheckcombList.length>0){
                    item.dimeMaincheckharmrecheckcombIds=item.dimeMaincheckharmrecheckcombList.map(x=>{
                      return x.combId
                    })
                  }
                  item.dimeBasecombcriterionDtoList=item.dimeMaincheckharmabnormalcombList
                  item.dimeMaincheckharmabnormalcombList.forEach(com=>{
                    this.$set(com, 'checked' ,true)
                  })
                  if(!item.dimeMaincheckharmadvice) {
                    item.dimeMaincheckharmadvice = {}
                  }
                })
                this.form = res.data
                this.form.headpicture=val.headpicture
                this.harms = this.form.maincheckHarmDtoList[0].baseHarmName;
              }
            })
          }
        }).finally(()=>{
          this.loading = false;
        });
      })
    },
    SeachCheckcode() {
      this.handleSearch()
    },
    InitCheckMainData() {
      this.GetPersonList();
      this.getCombList()
      this.harms = this.form.maincheckHarmDtoList[0].baseHarmName;
      //症状
      getBasesymptomlist({pageNum: 1,
        pageSize: 1000}).then(response => {
        this.symptomoptions = response.rows;
      });
      //现患疾病
      getBasediseaselist({pageNum: 1,
        pageSize: 1000}).then(response => {
        this.Diseasesoptions = response.rows;
      });
    },
    getCombList(){
      getbasecomblist({pageNum: 1,
        pageSize: 10000}).then(response => {
        this.comblists = response.rows;
      })
    },
    GetPersonList() {
      this.loading=true
      getMainChecklist().then(response => {
        this.DataPersonlist = response.data;
      }).finally(()=>{
        this.loading=false
      });
    },
    harmadviceChange(val, ele){
      this.$forceUpdate()
      const harmAdvice=ele.conclusionadviceList.filter((item) => {
        return item.id === val;
      })
      if(harmAdvice.length == 0) return
      ele.dimeMaincheckharmadvice.conclusionadvice=harmAdvice[0].conclusionadvice
      ele.dimeMaincheckharmadvice.conclusionId=ele.conclusionId
      ele.dimeMaincheckharmadvice.harmId=ele.baseHarmId
      ele.dimeMaincheckharmadvice.harmName=ele.baseHarmName
    },
    async HarmMainConsionChange(val, ele) {
      this.$set(ele, 'dimeMaincheckharmrecheckcombList', [])
      this.$set(ele, 'dimeMaincheckharmrecheckcombIds', [])
      this.$set(ele, 'dimeMaincheckharmoccupationaldiseaeList', [])
      this.$set(ele, 'dimeMaincheckharmoccupationaldiseaeIds', [])
      this.$set(ele, 'dimeMaincheckharmcontraindicationList', [])
      this.$set(ele, 'dimeMaincheckharmcontraindicationIds', [])
      this.$set(ele.dimeMaincheckharmadvice, 'conclusionadviceId', '')
      this.$set(ele.dimeMaincheckharmconclusion, 'advicedescribe', '')
      this.$set(ele, 'harmotherdisease', '')
      const response = await getbasemaincheckconclusionadvice({pageNum: 1,
         pageSize: 100,mainconclusionId:val})
       this.conclusionadvices = response.rows;
       let conclusionadviceList=this.conclusionadvices.filter((item) => {
         return item.mainconclusionId === val;
       })
       this.$set(ele, 'conclusionadviceList', conclusionadviceList)
       if(ele.conclusionadviceList.length>0){
         ele.showDec=false
       }
      this.setOptions(val, ele)
    },
    setOptions(val, ele) {
      const harmConclusion = this.conclusionoptions.filter((item) => {
        return item.id === val
      })
      if(harmConclusion.length == 0) return
      if (harmConclusion[0].recheckTag == '1') {
        ele.checkdisabled = false
      } else {
        ele.checkdisabled = true
      }
      if (harmConclusion[0].occupationalTag == '1') {
        ele.OCCDiseasesdisabled = false
      } else {
        ele.OCCDiseasesdisabled = true
      }
      if (harmConclusion[0].contraindicationTag == '1') {
        ele.contraindicationsdisabled = false
      } else {
        ele.contraindicationsdisabled = true
      }
      if (harmConclusion[0].otherTag == '1') {
        ele.otherdisabled = false
      } else {
        ele.otherdisabled = true
      }
      let abnormaldesc = ele.dimeMaincheckharmconclusion.abnormaldesc
      let advicedescribe = ele.dimeMaincheckharmconclusion.advicedescribe
      ele.dimeMaincheckharmconclusion = JSON.parse(JSON.stringify(harmConclusion[0]))
      ele.dimeMaincheckharmconclusion.conclusionId = harmConclusion[0].id
      ele.dimeMaincheckharmconclusion.harmId = ele.baseHarmId
      ele.dimeMaincheckharmconclusion.harmName = ele.baseHarmName
      ele.dimeMaincheckharmconclusion.abnormaldesc = abnormaldesc
      ele.dimeMaincheckharmconclusion.advicedescribe = advicedescribe
    },

    SelectHeathAdvice() {
      this.dialogHealthAdvice = true;
    },
    SaveSelectHealthAdvce() {
      this.SelectHealthAdvce = this.$refs.healthAdviceRef.getCheckedNodes()
      this.form.dimeMaincheckhealthadviceList=this.SelectHealthAdvce
      let healthLabel = ''
      this.SelectHealthAdvce.forEach(item=> {
        healthLabel += item.label + ' \n'
      })
      this.form.dimeMaincheckconclusion.healthDesc=healthLabel
      this.dialogHealthAdvice = false;
    },

    resetForm() {
      this.form = Object.assign({}, defaultForm);
      this.form.dimeMaincheckconclusion={}
    },
    bulidHarmAdvice(ele){
      if(!ele.dimeMaincheckharmconclusion.conclusion) {
        this.$message({
          message: "请选择危害结论",
          type: "warning",
        });
        return;
      }
      let harmAdvice=''
      if(ele.dimeMaincheckharmadvice.conclusionadvice){
        harmAdvice=ele.dimeMaincheckharmconclusion.conclusion+"；"+ele.dimeMaincheckharmadvice.conclusionadvice
      }else{
        harmAdvice=ele.dimeMaincheckharmconclusion.conclusion
      }
      ele.dimeMaincheckharmoccupationaldiseaeIds = ele.dimeMaincheckharmoccupationaldiseaeIds || []
      if(ele.dimeMaincheckharmoccupationaldiseaeIds.length==0 && harmAdvice.indexOf('【疑似职业病】') != -1){
        this.$message({
          message: "请选择疑似职业病",
          type: "warning",
        });
        return;
      }
      ele.dimeMaincheckharmcontraindicationIds = ele.dimeMaincheckharmcontraindicationIds || []
      if(ele.dimeMaincheckharmcontraindicationIds.length==0 && harmAdvice.indexOf('【职业禁忌症】') != -1){
        this.$message({
          message: "请选择职业禁忌症",
          type: "warning",
        });
        return;
      }
      ele.dimeMaincheckharmrecheckcombIds = ele.dimeMaincheckharmrecheckcombIds || []
      if(ele.dimeMaincheckharmrecheckcombIds.length==0 && harmAdvice.indexOf('【复查项目】') != -1){
        this.$message({
          message: "请选择复查项目",
          type: "warning",
        });
        return;
      }
      harmAdvice = harmAdvice.replace('【危害名称】',ele.baseHarmName )
      if(ele.dimeMaincheckharmabnormalcombList && ele.dimeMaincheckharmabnormalcombList.length>0) {
        let combNames = ''
        ele.dimeMaincheckharmabnormalcombList.forEach(
          item => {
            combNames += item.combName + '.'
          }
        )
        harmAdvice = harmAdvice.replace('【异常项目】',combNames )
      }
      if(ele.dimeMaincheckharmoccupationaldiseaeIds && ele.dimeMaincheckharmoccupationaldiseaeIds.length>0){
        let occupationaldiseae = ''
        ele.dimeMaincheckharmoccupationaldiseaeIds.forEach(
          id=> {
            ele.dimeBaseoccupationaldiseasecriterionList.forEach(item=>{
              if(id == item.occupationaldiseaeId) {
                occupationaldiseae += item.occupationaldiseaeName + '.'
              }
            })
          }
        )
        harmAdvice = harmAdvice.replace('【疑似职业病】',occupationaldiseae )
      }
      if(ele.dimeMaincheckharmcontraindicationList && ele.dimeMaincheckharmcontraindicationList.length>0){
        let contraindication = ''
        ele.dimeMaincheckharmcontraindicationIds.forEach(
          id=> {
            ele.dimeMaincheckharmcontraindicationList.forEach(item=>{
              if(id == item.cationcriterionId) {
                contraindication += item.cationcriterionName + '.'
              }
            })
          }
        )
        harmAdvice = harmAdvice.replace('【职业禁忌症】',contraindication )
      }
      if(ele.dimeMaincheckharmrecheckcombList && ele.dimeMaincheckharmrecheckcombList.length>0){
        let recheckcomb = ''
        ele.dimeMaincheckharmrecheckcombList.forEach(
          item=> {
            recheckcomb += item.combName + '.'
          }
        )
        harmAdvice = harmAdvice.replace('【复查项目】',recheckcomb )
      }
      this.$set(ele.dimeMaincheckharmconclusion, 'advicedescribe', harmAdvice)
      this.$forceUpdate();
      this.form.dimeMaincheckconclusion.conclusionadvice = ''
      this.form.maincheckHarmDtoList.forEach(item=>{
        if(item.dimeMaincheckharmconclusion.advicedescribe) {
          this.form.dimeMaincheckconclusion.conclusionadvice+=item.dimeMaincheckharmconclusion.advicedescribe+'；'
        }
      })
    },

    mainconclusionChange(val) {
      this.form.dimeMaincheckconclusion.conclusionadvice=''
      let conclusion=[]
      conclusion=this.conclusionoptions.filter((item) => {
        return item.id === val;
      })
      if(!conclusion || conclusion.length == 0) return
      this.form.dimeMaincheckconclusion.conclusion=conclusion[0].conclusion
      if(conclusion[0].passTag == 1 ) {
        this.form.maincheckHarmDtoList.forEach(item => {
          item.conclusionId = this.normalOptionId
          this.HarmMainConsionChange(this.normalOptionId, item)
        })
      } else if(conclusion[0].otherTag == 1){
        this.form.maincheckHarmDtoList.forEach(item => {
          item.conclusionId = this.otherOptionId
          this.HarmMainConsionChange(this.otherOptionId, item)
        })
      }else{
        this.dialogHarm=true
      }
      if(conclusion[0].otherTag == 1) {
        this.otherdiseaseTag=1
      }else{
        this.otherdiseaseTag=0
      }
    },
    dimeMaincheckharmoccupationaldiseaeChange(ids, ele) {
      ele.dimeMaincheckharmoccupationaldiseaeList = this.findListByIds(ids, ele.dimeBaseoccupationaldiseasecriterionList, 'occupationaldiseaeId')
      ele.dimeMaincheckharmoccupationaldiseaeList.forEach((x) => {
        x.harmId=ele.baseHarmId
        x.harmName=ele.baseHarmName
        x.harmconclusionId=ele.dimeMaincheckharmconclusion.id
        x.harmconclusionName=ele.dimeMaincheckharmconclusion.conclusion
      });
    },
    dimeMaincheckharmcontraindicationListChange(ids, ele) {
      ele.dimeMaincheckharmcontraindicationList = this.findListByIds(ids, ele.dimeBasecontraindicationcriterionList, 'cationcriterionId');
      ele.dimeMaincheckharmcontraindicationList.forEach((x) => {
        x.harmId=ele.baseHarmId
        x.harmName=ele.baseHarmName
        x.harmconclusionId=ele.dimeMaincheckharmconclusion.id
        x.harmconclusionName=ele.dimeMaincheckharmconclusion.conclusion
      });
    },
    Recheckcombchange(ids, ele) {
      ele.dimeMaincheckharmrecheckcombList = this.findListByIds(ids, this.comblists, 'id')
      ele.dimeMaincheckharmrecheckcombList.forEach((x) => {
        /*x.harmId=ele.baseHarmId
        x.harmName=ele.baseHarmName*/
        x.harmconclusionId=ele.dimeMaincheckharmconclusion.id
        x.harmconclusionName=ele.dimeMaincheckharmconclusion.conclusion
        x.combId=x.id
        x.groupId=x.dimeGroupsid
      });
    },
    findListByIds(ids, list, key) {
      let items = []
      ids.forEach(id=>{
        list.forEach(item=>{
          if(item[key] == id) {
            items.push(item)
          }
        })
      })
      return items
    },
    revokeForm() {
      this.$confirm("确定是否撤销审核", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          revokeMaincheck(this.choosedPersonInfo).then(response => {
            this.$notify({
              title: "成功",
              message: "撤销成功",
              type: "success",
              duration: 2000,
            });
            this.GetPersonList()
            this.form.completStatus="1"
          })
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },

    save() {
      for(let i = 0; i < this.form.maincheckHarmDtoList.length; i++) {
        if(!this.form.maincheckHarmDtoList[i].conclusionId) {
          this.$message({
            message: "请选择危害结论",
            type: "warning",
          });
          return;
        }
        this.form.maincheckHarmDtoList[i].dimeMaincheckharmoccupationaldiseaeIds = this.form.maincheckHarmDtoList[i].dimeMaincheckharmoccupationaldiseaeIds || []
       if(this.form.maincheckHarmDtoList[i].dimeMaincheckharmoccupationaldiseaeIds.length==0&&this.form.maincheckHarmDtoList[i].OCCDiseasesdisabled==false) {
          this.$message({
            message: "请选择疑似职业病",
            type: "warning",
          });
          return;
        }
        this.form.maincheckHarmDtoList[i].dimeMaincheckharmcontraindicationIds = this.form.maincheckHarmDtoList[i].dimeMaincheckharmcontraindicationIds || []
        if(this.form.maincheckHarmDtoList[i].dimeMaincheckharmcontraindicationIds.length==0&&this.form.maincheckHarmDtoList[i].contraindicationsdisabled==false) {
          this.$message({
            message: "请选择职业禁忌症",
            type: "warning",
          });
          return;
        }
        this.form.maincheckHarmDtoList[i].dimeMaincheckharmrecheckcombIds = this.form.maincheckHarmDtoList[i].dimeMaincheckharmrecheckcombIds || []
        if(this.form.maincheckHarmDtoList[i].dimeMaincheckharmrecheckcombIds.length==0&&this.form.maincheckHarmDtoList[i].checkdisabled==false) {
          this.$message({
            message: "请选择复查项目",
            type: "warning",
          });
          return;
        }
      }
      if (this.otherdiseaseTag==1&&this.form.abnormalDimePhysicalitems&&this.form.abnormalDimePhysicalitems.length==0) {
        this.$message({
          message: "请选择其他疾病和异常",
          type: "warning",
        });
        return;
      }
      this.formLoading = true;
      saveMaincheck(this.form).then(response => {
        this.$modal.msgSuccess("操作成功");
        this.GetPersonList()
        this.choosedPersonInfo.completStatus="2"
        this.handleCurrentChange(this.choosedPersonInfo)
      }).finally(()=>{
        this.formLoading = false;
      });
    },

    cancel() {
      this.dialogFormVisible = false;
      this.dialogHealthAdvice = false;
      this.dialogSearch = false;
    },
    handleHarmChange(val){
      this.choosedHarm = val;
      this.choosedHarm.forEach((item) => {
        item.conclusionId=this.form.dimeMaincheckconclusion.conclusionId
      });
    },
    handleDiseaseChange(val){
     this.form.abnormalDimePhysicalitems=val
    },
    handleSelectionChange(ele) {
      ele.dimeBasecombcriterionDtoList = ele.dimeBasecombcriterionDtoList || []
      let selectList = ele.dimeBasecombcriterionDtoList.filter(item=>{
        return item.checked
      })
      ele.dimeMaincheckharmabnormalcombList=selectList
      ele.dimeMaincheckharmabnormalcombList.forEach((x) => {
        x.harmId=ele.baseHarmId
        x.harmName=ele.baseHarmName
      });
    },
  },
};
</script>
<style>
.red-row {
  background-color: #ffd8d8!important;
}
</style>
<style scoped lang="scss">
.head-container{
  height: calc(100vh - 180px);
  overflow-y: auto;
}

.el-form .el-select {
  width: 100%;
}
.tip {
  padding: 10px 10px;
  background-color: #ecf8ff;
  border-radius: 4px;
  border-left: 5px solid #50bfff;
  margin: 5px 0;
}
.more{
  font-size: 12px;
  color: #1890ff;
  margin-left: 4px;
  white-space: nowrap;
  cursor:pointer;
}
.button-container {
  padding: 2px 10px 3px 2px;
}
.el-form-item {
  margin-bottom: 14px !important;
}

.el-input-number.full-width-input,
.el-cascader.full-width-input {
  width: 100% !important;
}

.el-form-item--medium {
  .el-radio {
    line-height: 36px !important;
  }

  .el-rate {
    margin-top: 8px;
  }
}

.el-col {
  border-radius: 4px;
  padding: 4px;
}

.el-form-item--small {
  .el-radio {
    line-height: 32px !important;
  }

  .el-rate {
    margin-top: 6px;
  }
}
.el-form-item--mini {
  .el-radio {
    line-height: 28px !important;
  }
  .el-rate {
    margin-top: 4px;
  }
}
.clear-fix:before,
.clear-fix:after {
  display: table;
  content: "";
}
.clear-fix:after {
  clear: both;
}
.float-right {
  float: right;
}
</style>

<style lang="scss" scoped>
div.table-container {
  table.table-layout {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    td.table-cell {
      display: table-cell;
      height: 36px;
      border: 1px solid #e1e2e3;
    }
  }
}
::v-deep .el-tree-node__content{
  margin-bottom: 4px;
}
::v-deep .el-tree-node__label{
  overflow: hidden;  // 隐藏超出的文本
  text-overflow: ellipsis;  // 使用省略号表示超出的文本
  white-space: nowrap;  // 不换行
}

.label-left-align ::v-deep .el-form-item__label {
  text-align: left;
}

.label-center-align ::v-deep .el-form-item__label {
  text-align: center;
}

.label-right-align ::v-deep .el-form-item__label {
  text-align: right;
}

.static-content-item {
  min-height: 20px;
  display: flex;
  align-items: center;

  ::v-deep .el-divider--horizontal {
    margin: 0;
  }
}
::v-deep .el-dialog__body{
  padding-top: 10px;
}
.conclusion{
  display: flex;
  align-items: center;
  margin-top: 10px;
  font-size: 14px;
  font-weight: bold;
  color: #313131;
}
</style>
